1619962776
In this article, we’ll discuss information about the Media Network project and MEDIA token
Media Network
A new protocol that bypasses traditional CDN providers’ centralized approach for a self-governed and open source solution where everyone can participate. A distributed economy that enables anyone with spare bandwidth resources to monetize them, earning MEDIA Network Tokens in exchange for their contributions to the network.
Any existing infrastructure can now be scaled by hiring bandwidth-on-demand without constraining long-term business commitments or compromising privacy. No accounts, KYC, or personal information is required at any point for any of the participants of the network.
How It Works
Media Network creates a distributed bandwidth market that enables service providers such as media platforms to hire resources from the network and dynamically come and go as the demand for last-mile data delivery shifts. It allows anyone to organically set up new Media Edges and serve content without introducing any trust assumptions or pre-authentication requirements. These participants earn MEDIA rewards for their bandwidth contributions, a fixed supply SPL token minted on Solana’s Blockchain. The protocol utilizes new mechanisms to encourage honest and collaborative work between participants of the network.
CDN Service
To scale an existing infrastructure, developers or media platforms will have to buy MEDIA off exchanges, provide liquidity to any designated Serum DEX pools, and stake the resulting LP MEDIA tokens. After that, they will have to authenticate with a Solana compatible wallet to any of the available front-ends (e.g., Media App) and set up their resources and custom settings.
Once the transactions are confirmed, Media Guards will verify the amount of staked LP MEDIA tokens and, if conditions are met, authorize the new resource into the network assigning bandwidth quotas, DNS names, and security settings. Everything is encrypted with a password and recorded on Solana’s blockchain.
Fees
Data transfer fees are deducted automatically from the stake, depending on consumption and the community’s current fee pricing. Bandwidth quota depends on the amount of LP tokens staked; the more MEDIA staked, the more burstable bandwidth available for a specific resource’s end-users. As the stake gets reduced by the data consumption, so is the bandwidth available for that specific resource.
100% Blockchain Based
Media Edges listening to these on-chain transactions will then start pulling the content from the origin and replicating it worldwide, relaying the data on-demand. End users requesting the new provided URL instead of the original path to the source will get the data from the closest edge based on geolocation and latency, optimizing last-mile delivery. Now anyone can quickly scale heavy multimedia-dependent applications or websites and hold millions of requests simultaneously without the need to be an engineer or compromising privacy at any point.
Why Media Network?
Anonymous
No sign-up required. Be part of the network without any type of contracts or KYC.
Decentralized
A truly censorship-resistant ecosystem powered by peer-to-peer technology.
Scalable
A novel architecture that improves performance when more peers join the network.
Ecosystem
Media PeerPool
A CDN agnostic system that reduces up to 99% of bandwidth costs by leveraging peer-to-peer browser functionality.
Media Edge
An open-source software for web serving, reverse proxying, caching, load balancing, media streaming, and more.
Media Guard
Designed to secure the network through consensus, proposing
MEDIA rewards and removing malicious peers.
Media Server
A lightweight but powerful multi-protocol live streaming server solution. Featuring built-in peer-to-peer capabilities.
Network Participants
Token-holders
Earn MEDIA while sharing bandwidth with other peers.
Websites/Apps
Scale your existing infrastructure and reach millions of users.
Bandwidth providers
Run a node, help the network scale and earn MEDIA
MEDIA Network Token
MEDIA is the cornerstone and vital artery of the network’s economy. It is the medium of exchange between bandwidth providers and anyone renting the CDN service, powering and enabling the long-term ecosystem self-sustainability.
Fair Launch
No private sale, with an IDO in which anyone will be able to participate.
Governance
MEDIA holders have the power to influence decisions concerning the core protocol.
Network Credits
MEDIA tokens are used as credits to pay bandwidth providers for data consumption.
Bandwidth Burst
Staked Media LP MEDIA amount weighs towards the maximum allocated bandwidth.
Deflationary
A revolutionary buy-back & burn mechanism, a nice incentive for token-holders.
Incentives
MEDIA tokens can be staked to generate rewards, bootstrapping the community.
Media App is a front-end created by the Media Foundation to interact with Solana’s Blockchain, Serum AMM’s, and to participate in the distributed economy. It is compatible with any SPL (Solana Program Library) wallet and enables developers to set up and configure resources on the network, like new origins or allowed domains to use the Media PeerPool library.
Media App front-end shows all limits and quotas available per resource automatically based on wallet weight.
app.media.network
MEDIA has been listed on a number of crypto exchanges, unlike other main cryptocurrencies, it cannot be directly purchased with fiats money. However, You can still easily buy this coin by first buying Bitcoin, ETH, USDT, BNB from any large exchanges and then transfer to the exchange that offers to trade this coin, in this guide article we will walk you through in detail the steps to buy MEDIA token.
You will have to first buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
We will use Binance Exchange here as it is one of the largest crypto exchanges that accept fiat deposits.
Binance is a popular cryptocurrency exchange which was started in China but then moved their headquarters to the crypto-friendly Island of Malta in the EU. Binance is popular for its crypto to crypto exchange services. Binance exploded onto the scene in the mania of 2017 and has since gone on to become the top crypto exchange in the world.
Once you finished the KYC process. You will be asked to add a payment method. Here you can either choose to provide a credit/debit card or use a bank transfer, and buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
Step by Step Guide : What is Binance | How to Create an account on Binance (Updated 2021)
Next step - Transfer your cryptos to an Altcoin Exchange
Since MEDIA is an altcoin we need to transfer our coins to an exchange that MEDIA can be traded. Below is a list of exchanges that offers to trade MEDIA in various market pairs, head to their websites and register for an account.
Once finished you will then need to make a BTC/ETH/USDT/BNB deposit to the exchange from Binance depending on the available market pairs. After the deposit is confirmed you may then purchase MEDIA from the exchange.
The top exchange for trading in MEDIA token is currently Serum DEX and FTX
Apart from the exchange(s) above, there are a few popular crypto exchanges where they have decent daily trading volumes and a huge user base. This will ensure you will be able to sell your coins at any time and the fees will usually be lower. It is suggested that you also register on these exchanges since once MEDIA gets listed there it will attract a large amount of trading volumes from the users there, that means you will be having some great trading opportunities!
Top exchanges for token-coin trading. Follow instructions and make unlimited money
☞ https://www.binance.com
☞ https://www.bittrex.com
☞ https://www.poloniex.com
☞ https://www.bitfinex.com
☞ https://www.huobi.com
Find more information MEDIA
☞ Website ☞ Explorer ☞ Social Channel ☞ Social Channel 2 ☞ Coinmarketcap
🔺DISCLAIMER: The Information in the post isn’t financial advice, is intended FOR GENERAL INFORMATION PURPOSES ONLY. Trading Cryptocurrency is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money.
🔥 If you’re a beginner. I believe the article below will be useful to you
⭐ ⭐ ⭐ What You Should Know Before Investing in Cryptocurrency - For Beginner ⭐ ⭐ ⭐
Thank for visiting and reading this article! Please don’t forget to leave a like, comment and share!
#blockchain #bitcoin #media #media network
1619962776
In this article, we’ll discuss information about the Media Network project and MEDIA token
Media Network
A new protocol that bypasses traditional CDN providers’ centralized approach for a self-governed and open source solution where everyone can participate. A distributed economy that enables anyone with spare bandwidth resources to monetize them, earning MEDIA Network Tokens in exchange for their contributions to the network.
Any existing infrastructure can now be scaled by hiring bandwidth-on-demand without constraining long-term business commitments or compromising privacy. No accounts, KYC, or personal information is required at any point for any of the participants of the network.
How It Works
Media Network creates a distributed bandwidth market that enables service providers such as media platforms to hire resources from the network and dynamically come and go as the demand for last-mile data delivery shifts. It allows anyone to organically set up new Media Edges and serve content without introducing any trust assumptions or pre-authentication requirements. These participants earn MEDIA rewards for their bandwidth contributions, a fixed supply SPL token minted on Solana’s Blockchain. The protocol utilizes new mechanisms to encourage honest and collaborative work between participants of the network.
CDN Service
To scale an existing infrastructure, developers or media platforms will have to buy MEDIA off exchanges, provide liquidity to any designated Serum DEX pools, and stake the resulting LP MEDIA tokens. After that, they will have to authenticate with a Solana compatible wallet to any of the available front-ends (e.g., Media App) and set up their resources and custom settings.
Once the transactions are confirmed, Media Guards will verify the amount of staked LP MEDIA tokens and, if conditions are met, authorize the new resource into the network assigning bandwidth quotas, DNS names, and security settings. Everything is encrypted with a password and recorded on Solana’s blockchain.
Fees
Data transfer fees are deducted automatically from the stake, depending on consumption and the community’s current fee pricing. Bandwidth quota depends on the amount of LP tokens staked; the more MEDIA staked, the more burstable bandwidth available for a specific resource’s end-users. As the stake gets reduced by the data consumption, so is the bandwidth available for that specific resource.
100% Blockchain Based
Media Edges listening to these on-chain transactions will then start pulling the content from the origin and replicating it worldwide, relaying the data on-demand. End users requesting the new provided URL instead of the original path to the source will get the data from the closest edge based on geolocation and latency, optimizing last-mile delivery. Now anyone can quickly scale heavy multimedia-dependent applications or websites and hold millions of requests simultaneously without the need to be an engineer or compromising privacy at any point.
Why Media Network?
Anonymous
No sign-up required. Be part of the network without any type of contracts or KYC.
Decentralized
A truly censorship-resistant ecosystem powered by peer-to-peer technology.
Scalable
A novel architecture that improves performance when more peers join the network.
Ecosystem
Media PeerPool
A CDN agnostic system that reduces up to 99% of bandwidth costs by leveraging peer-to-peer browser functionality.
Media Edge
An open-source software for web serving, reverse proxying, caching, load balancing, media streaming, and more.
Media Guard
Designed to secure the network through consensus, proposing
MEDIA rewards and removing malicious peers.
Media Server
A lightweight but powerful multi-protocol live streaming server solution. Featuring built-in peer-to-peer capabilities.
Network Participants
Token-holders
Earn MEDIA while sharing bandwidth with other peers.
Websites/Apps
Scale your existing infrastructure and reach millions of users.
Bandwidth providers
Run a node, help the network scale and earn MEDIA
MEDIA Network Token
MEDIA is the cornerstone and vital artery of the network’s economy. It is the medium of exchange between bandwidth providers and anyone renting the CDN service, powering and enabling the long-term ecosystem self-sustainability.
Fair Launch
No private sale, with an IDO in which anyone will be able to participate.
Governance
MEDIA holders have the power to influence decisions concerning the core protocol.
Network Credits
MEDIA tokens are used as credits to pay bandwidth providers for data consumption.
Bandwidth Burst
Staked Media LP MEDIA amount weighs towards the maximum allocated bandwidth.
Deflationary
A revolutionary buy-back & burn mechanism, a nice incentive for token-holders.
Incentives
MEDIA tokens can be staked to generate rewards, bootstrapping the community.
Media App is a front-end created by the Media Foundation to interact with Solana’s Blockchain, Serum AMM’s, and to participate in the distributed economy. It is compatible with any SPL (Solana Program Library) wallet and enables developers to set up and configure resources on the network, like new origins or allowed domains to use the Media PeerPool library.
Media App front-end shows all limits and quotas available per resource automatically based on wallet weight.
app.media.network
MEDIA has been listed on a number of crypto exchanges, unlike other main cryptocurrencies, it cannot be directly purchased with fiats money. However, You can still easily buy this coin by first buying Bitcoin, ETH, USDT, BNB from any large exchanges and then transfer to the exchange that offers to trade this coin, in this guide article we will walk you through in detail the steps to buy MEDIA token.
You will have to first buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
We will use Binance Exchange here as it is one of the largest crypto exchanges that accept fiat deposits.
Binance is a popular cryptocurrency exchange which was started in China but then moved their headquarters to the crypto-friendly Island of Malta in the EU. Binance is popular for its crypto to crypto exchange services. Binance exploded onto the scene in the mania of 2017 and has since gone on to become the top crypto exchange in the world.
Once you finished the KYC process. You will be asked to add a payment method. Here you can either choose to provide a credit/debit card or use a bank transfer, and buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
Step by Step Guide : What is Binance | How to Create an account on Binance (Updated 2021)
Next step - Transfer your cryptos to an Altcoin Exchange
Since MEDIA is an altcoin we need to transfer our coins to an exchange that MEDIA can be traded. Below is a list of exchanges that offers to trade MEDIA in various market pairs, head to their websites and register for an account.
Once finished you will then need to make a BTC/ETH/USDT/BNB deposit to the exchange from Binance depending on the available market pairs. After the deposit is confirmed you may then purchase MEDIA from the exchange.
The top exchange for trading in MEDIA token is currently Serum DEX and FTX
Apart from the exchange(s) above, there are a few popular crypto exchanges where they have decent daily trading volumes and a huge user base. This will ensure you will be able to sell your coins at any time and the fees will usually be lower. It is suggested that you also register on these exchanges since once MEDIA gets listed there it will attract a large amount of trading volumes from the users there, that means you will be having some great trading opportunities!
Top exchanges for token-coin trading. Follow instructions and make unlimited money
☞ https://www.binance.com
☞ https://www.bittrex.com
☞ https://www.poloniex.com
☞ https://www.bitfinex.com
☞ https://www.huobi.com
Find more information MEDIA
☞ Website ☞ Explorer ☞ Social Channel ☞ Social Channel 2 ☞ Coinmarketcap
🔺DISCLAIMER: The Information in the post isn’t financial advice, is intended FOR GENERAL INFORMATION PURPOSES ONLY. Trading Cryptocurrency is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money.
🔥 If you’re a beginner. I believe the article below will be useful to you
⭐ ⭐ ⭐ What You Should Know Before Investing in Cryptocurrency - For Beginner ⭐ ⭐ ⭐
Thank for visiting and reading this article! Please don’t forget to leave a like, comment and share!
#blockchain #bitcoin #media #media network
1625816471
Efficient social media management could mean you getting the desired online recognition and leads for your business (if that was your intend to stay active on social media). Unfortunately, the common practice of social media management requires you to switch between multiple accounts of yours. This requires significant time and effort on your part. Stratus addresses this problem by bringing all of the social media channels on a single platform. You can access and manage your social media accounts in a single place while saving your time and effort. The user-friendly interface and advanced features integrated into the Stratus platform make it one of the best social media posting tools. To learn more or to sign up on Stratus, visit https://stratus.co/
#best social media posting tools #social media management #manage social media accounts in one place #best social media management tools #manage all social media in one place #social media management tools
1658068560
WordsCounted
We are all in the gutter, but some of us are looking at the stars.
-- Oscar Wilde
WordsCounted is a Ruby NLP (natural language processor). WordsCounted lets you implement powerful tokensation strategies with a very flexible tokeniser class.
["Bayrūt"]
and not ["Bayr", "ū", "t"]
, for example.Add this line to your application's Gemfile:
gem 'words_counted'
And then execute:
$ bundle
Or install it yourself as:
$ gem install words_counted
Pass in a string or a file path, and an optional filter and/or regexp.
counter = WordsCounted.count(
"We are all in the gutter, but some of us are looking at the stars."
)
# Using a file
counter = WordsCounted.from_file("path/or/url/to/my/file.txt")
.count
and .from_file
are convenience methods that take an input, tokenise it, and return an instance of WordsCounted::Counter
initialized with the tokens. The WordsCounted::Tokeniser
and WordsCounted::Counter
classes can be used alone, however.
WordsCounted.count(input, options = {})
Tokenises input and initializes a WordsCounted::Counter
object with the resulting tokens.
counter = WordsCounted.count("Hello Beirut!")
Accepts two options: exclude
and regexp
. See Excluding tokens from the analyser and Passing in a custom regexp respectively.
WordsCounted.from_file(path, options = {})
Reads and tokenises a file, and initializes a WordsCounted::Counter
object with the resulting tokens.
counter = WordsCounted.from_file("hello_beirut.txt")
Accepts the same options as .count
.
The tokeniser allows you to tokenise text in a variety of ways. You can pass in your own rules for tokenisation, and apply a powerful filter with any combination of rules as long as they can boil down into a lambda.
Out of the box the tokeniser includes only alpha chars. Hyphenated tokens and tokens with apostrophes are considered a single token.
#tokenise([pattern: TOKEN_REGEXP, exclude: nil])
tokeniser = WordsCounted::Tokeniser.new("Hello Beirut!").tokenise
# With `exclude`
tokeniser = WordsCounted::Tokeniser.new("Hello Beirut!").tokenise(exclude: "hello")
# With `pattern`
tokeniser = WordsCounted::Tokeniser.new("I <3 Beirut!").tokenise(pattern: /[a-z]/i)
See Excluding tokens from the analyser and Passing in a custom regexp for more information.
The WordsCounted::Counter
class allows you to collect various statistics from an array of tokens.
#token_count
Returns the token count of a given string.
counter.token_count #=> 15
#token_frequency
Returns a sorted (unstable) two-dimensional array where each element is a token and its frequency. The array is sorted by frequency in descending order.
counter.token_frequency
[
["the", 2],
["are", 2],
["we", 1],
# ...
["all", 1]
]
#most_frequent_tokens
Returns a hash where each key-value pair is a token and its frequency.
counter.most_frequent_tokens
{ "are" => 2, "the" => 2 }
#token_lengths
Returns a sorted (unstable) two-dimentional array where each element contains a token and its length. The array is sorted by length in descending order.
counter.token_lengths
[
["looking", 7],
["gutter", 6],
["stars", 5],
# ...
["in", 2]
]
#longest_tokens
Returns a hash where each key-value pair is a token and its length.
counter.longest_tokens
{ "looking" => 7 }
#token_density([ precision: 2 ])
Returns a sorted (unstable) two-dimentional array where each element contains a token and its density as a float, rounded to a precision of two. The array is sorted by density in descending order. It accepts a precision
argument, which must be a float.
counter.token_density
[
["are", 0.13],
["the", 0.13],
["but", 0.07 ],
# ...
["we", 0.07 ]
]
#char_count
Returns the char count of tokens.
counter.char_count #=> 76
#average_chars_per_token([ precision: 2 ])
Returns the average char count per token rounded to two decimal places. Accepts a precision argument which defaults to two. Precision must be a float.
counter.average_chars_per_token #=> 4
#uniq_token_count
Returns the number of unique tokens.
counter.uniq_token_count #=> 13
You can exclude anything you want from the input by passing the exclude
option. The exclude option accepts a variety of filters and is extremely flexible.
:odd?
.tokeniser =
WordsCounted::Tokeniser.new(
"Magnificent! That was magnificent, Trevor."
)
# Using a string
tokeniser.tokenise(exclude: "was magnificent")
# => ["that", "trevor"]
# Using a regular expression
tokeniser.tokenise(exclude: /trevor/)
# => ["magnificent", "that", "was", "magnificent"]
# Using a lambda
tokeniser.tokenise(exclude: ->(t) { t.length < 4 })
# => ["magnificent", "that", "magnificent", "trevor"]
# Using symbol
tokeniser = WordsCounted::Tokeniser.new("Hello! محمد")
tokeniser.tokenise(exclude: :ascii_only?)
# => ["محمد"]
# Using an array
tokeniser = WordsCounted::Tokeniser.new(
"Hello! اسماءنا هي محمد، كارولينا، سامي، وداني"
)
tokeniser.tokenise(
exclude: [:ascii_only?, /محمد/, ->(t) { t.length > 6}, "و"]
)
# => ["هي", "سامي", "وداني"]
The default regexp accounts for letters, hyphenated tokens, and apostrophes. This means twenty-one is treated as one token. So is Mohamad's.
/[\p{Alpha}\-']+/
You can pass your own criteria as a Ruby regular expression to split your string as desired.
For example, if you wanted to include numbers, you can override the regular expression:
counter = WordsCounted.count("Numbers 1, 2, and 3", pattern: /[\p{Alnum}\-']+/)
counter.tokens
#=> ["numbers", "1", "2", "and", "3"]
Use the from_file
method to open files. from_file
accepts the same options as .count
. The file path can be a URL.
counter = WordsCounted.from_file("url/or/path/to/file.text")
A hyphen used in leu of an em or en dash will form part of the token. This affects the tokeniser algorithm.
counter = WordsCounted.count("How do you do?-you are well, I see.")
counter.token_frequency
[
["do", 2],
["how", 1],
["you", 1],
["-you", 1], # WTF, mate!
["are", 1],
# ...
]
In this example -you
and you
are separate tokens. Also, the tokeniser does not include numbers by default. Remember that you can pass your own regular expression if the default behaviour does not fit your needs.
The program will normalise (downcase) all incoming strings for consistency and filters.
def self.from_url
# open url and send string here after removing html
end
Are you using WordsCounted to do something interesting? Please tell me about it.
Visit this website for one example of what you can do with WordsCounted.
Contributors
See contributors.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Author: Abitdodgy
Source Code: https://github.com/abitdodgy/words_counted
License: MIT license
1662360645
Trong thế giới kỹ thuật số, trình phát video HTML5 hiện là loại trình phát video được sử dụng rộng rãi nhất. Do tính tương thích và khả năng thích ứng cao, các trình phát video này giúp các đài truyền hình mở rộng khán giả cho các luồng của họ. Để tải nội dung từ CDN video hoặc trình phát video trực tuyến lưu trữ phát trực tuyến, trình phát video HTML5 sử dụng giao thức HTTPS Live Streaming (HLS) được tạo riêng để phát trực tuyến.
Trình phát video HTML5 cung cấp cho các đài truyền hình sự trợ giúp mà họ cần để tiếp cận hiệu quả lượng khán giả lớn. Bởi vì điều này, nó nhanh chóng trở nên phổ biến và vẫn là lựa chọn ưa thích của các đài truyền hình.
Ngx-Videogular là một khung công tác đa phương tiện mạnh mẽ được điều khiển bởi Angular. Sự phát triển của trình phát video trang web HTML5 cho Ứng dụng Angular làm cho việc sử dụng khung phương tiện này đặc biệt tốt. Như tên của nó, Ngx-Videogular là một khuôn khổ phương tiện được tạo trong Angular.
Với sự trợ giúp của một số thẻ và thuộc tính được thêm vào mã HTML, bạn có thể xây dựng trình phát video tùy chỉnh của mình bằng cách sử dụng Ngx-Videogular, công cụ này chủ yếu dựa trên các tiêu chuẩn HTML5.
Bạn có thể suy nghĩ về quan niệm sau đây: Tại sao lại sử dụng Angular cho video hơn là trình phát video HTML5? Tôi cho rằng chúng tôi có thể đáp ứng điều đó bằng cách sử dụng các tính năng của Videogular. Bạn thấy đấy, Ngx-Videogular đi kèm với các tính năng nội tại phù hợp nhất với các Ứng dụng Angular. Các tính năng này đi kèm với các tùy chọn trình phát video HTML5 dựng sẵn để điều khiển video.
Bạn có thể tạo ứng dụng video Angular có khả năng phát triển trong tương lai và đạt được một số lợi thế bằng cách sử dụng plugin Ngx-Videogular:
Hãy xem cách chúng tôi có thể triển khai trình phát video Ngx-Videogular trong ứng dụng Angular của chúng tôi.
ng new angular-videoplayer-app
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS
cd angular-videoplayer-app
npm install @videogular/ngx-videogular --save
npm install @types/core-js --save-dev
"styles": [
"node_modules/@videogular/ngx-videogular/fonts/videogular.css",
"styles.scss"
],
//app.module.ts//
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {VgCoreModule} from '@videogular/ngx-videogular/core';
import {VgControlsModule} from '@videogular/ngx-videogular/controls';
import {VgOverlayPlayModule} from '@videogular/ngx-videogular/overlay-play';
import {VgBufferingModule} from '@videogular/ngx-videogular/buffering';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
VgCoreModule,
VgControlsModule,
VgOverlayPlayModule,
VgBufferingModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
<h3>Basic Video Player</h3>
<vg-player>
<video [vgMedia]="$any(media)" #media id="singleVideo" preload="auto" controls>
<source src=" " type="video/mp4">
</video>
</vg-player>
Điều này quá đơn giản và không có gì để xem ở đây. Nhưng điều gì sẽ xảy ra nếu chúng tôi thêm một liên kết đến nguồn video của chúng tôi bên dưới?
<vg-player>
<video [vgMedia]="$any(media)" #media id="singleVideo" preload="auto" controls>
<source src="http://static.videogular.com/assets/videos/videogular.mp4" type="video/mp4">
</video>
</vg-player>
Điều này thật hay, nhưng nếu chúng ta thêm một số tính năng để làm cho nó trông thực tế, chúng ta nên thêm các điều khiển tùy chỉnh để tạo da cho nó một cách phù hợp.
Việc tích hợp các thành phần khác nhau cho phép trình phát video Videogular cung cấp các điều khiển trình phát chuyên biệt như Điều khiển tốc độ, Trạng thái, các nút Phát / Tạm dừng, Bộ đệm video và thanh phát cũng như các nút Tắt tiếng và Âm lượng. Thêm các phần tử sau vào mẫu thành phần Ứng dụng để tạo các điều khiển tùy chỉnh cho trình phát video.
<div>
<h3>Basic Video Player</h3>
<vg-player>
<vg-overlay-play></vg-overlay-play>
<vg-buffering></vg-buffering>
<vg-scrub-bar>
<vg-scrub-bar-current-time></vg-scrub-bar-current-time>
<vg-scrub-bar-buffering-time></vg-scrub-bar-buffering-time>
</vg-scrub-bar>
<vg-controls>
<vg-play-pause></vg-play-pause>
<vg-playback-button></vg-playback-button>
<vg-time-display vgProperty="current" vgFormat="mm:ss"></vg-time-display>
<vg-scrub-bar style="pointer-events: none;"></vg-scrub-bar>
<vg-time-display vgProperty="left" vgFormat="mm:ss"></vg-time-display>
<vg-time-display vgProperty="total" vgFormat="mm:ss"></vg-time-display>
<vg-track-selector></vg-track-selector>
<vg-mute></vg-mute>
<vg-volume></vg-volume>
<vg-fullscreen></vg-fullscreen>
</vg-controls>
<video [vgMedia]="$any(media)" #media id="singleVideo" preload="auto" crossorigin>
<source src="http://static.videogular.com/assets/videos/videogular.mp4" type="video/mp4">
<track kind="subtitles" label="English" src="http://static.videogular.com/assets/subs/pale-blue-dot.vtt" srclang="en" default>
<track kind="subtitles" label="Español" src="http://static.videogular.com/assets/subs/pale-blue-dot-es.vtt" srclang="es">
</video>
</vg-player>
</div>
Điều này sẽ cung cấp cho trình phát video một bố cục và biểu tượng tùy chỉnh độc đáo.
Những gì chúng ta sẽ làm là cập nhật app.component.tsđối tượng Danh sách phát và các phương thức Trình phát
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'angular-videoplayer-app';
playlist = [
{
title: 'Agent 327!',
src: 'https://media.vimejs.com/720p.mp4',
type: 'video/mp4'
},
{
title: 'Big Buck Bunny',
src: 'http://static.videogular.com/assets/videos/big_buck_bunny_720p_h264.mov',
type: 'video/mp4'
},
{
title: 'Messi Goal',
src: 'http://static.videogular.com/assets/videos/goal-2.mp4',
type: 'video/mp4'
}
];
currentIndex = 0;
activeVideo = this.playlist[this.currentIndex];
api!: { getDefaultMedia: () => { (): any; new(): any; subscriptions: { (): any; new(): any; loadedMetadata: { (): any; new(): any; subscribe: { (arg0: () => void): void; new(): any; }; }; ended: { (): any; new(): any; subscribe: { (arg0: () => void): void; new(): any; }; }; }; }; play: () => void; };
constructor() {
}
onPlayerSet(api: any) {
this.api = api;
this.api.getDefaultMedia().subscriptions.loadedMetadata.subscribe(this.startVideo.bind(this));
this.api.getDefaultMedia().subscriptions.ended.subscribe(this.nextVideo.bind(this));
}
nextVideo() {
this.currentIndex++;
if (this.currentIndex === this.playlist.length) {
this.currentIndex = 0;
}
this.activeVideo = this.playlist[this.currentIndex];
}
startVideo() {
this.api.play();
}
onClickPlaylistVideo(item: { title: string; src: string; type: string; }, index: number) {
this.currentIndex = index;
this.activeVideo = item;
}
}
Cập nhật app.component.htmlvới người nghe sự kiện để thêm danh sách phát bên dưới trình phát video.
<div>
<h3>Basic Video Player</h3>
<vg-player>
...
...
<video [vgMedia]="$any(media)" #media [src]="activeVideo.src" id="singleVideo" preload="auto" crossorigin>
</video>
</vg-player>
<ul>
<li class="playlist-item" *ngFor="let video of playlist; let $index = index"
(click)="onClickPlaylistVideo(video, $index)" [class.selected]="video === activeVideo">
{{ video.title }}
</li>
</ul>
</div>
Trình phát có danh sách phát sẽ xuất hiện như sau:
À chính nó đấy; hướng dẫn Angular Video Player hiện đã hoàn tất. Hướng dẫn này đề cập đến plugin trình phát video tốt nhất cho các ứng dụng góc cạnh để kết hợp trình phát video với các điều khiển tùy chỉnh. Đối với mã nguồn, vui lòng nhấp vào liên kết Github .
Liên kết: https://blog.openreplay.com/playing-videos-in-angular-with-ngx-videogular
#angular #javascript
1662367927
Dans le monde numérique, les lecteurs vidéo HTML5 sont actuellement le type de lecteur vidéo le plus utilisé. En raison de leur grande compatibilité et adaptabilité, ces lecteurs vidéo aident les diffuseurs à élargir l'audience de leurs flux. Pour obtenir le contenu du CDN vidéo ou du lecteur vidéo en ligne hébergeant le streaming, les lecteurs vidéo HTML5 utilisent le protocole HTTPS Live Streaming (HLS) créé spécifiquement pour le streaming.
Le lecteur vidéo HTML5 fournit aux diffuseurs l'assistance dont ils ont besoin pour atteindre efficacement des audiences importantes. Pour cette raison, il a rapidement gagné en popularité et est resté le choix préféré des diffuseurs.
Ngx-Videogular est un cadre multimédia robuste piloté par Angular. Le développement de lecteurs vidéo de sites Web HTML5 pour les applications angulaires utilise particulièrement bien ce cadre multimédia. Comme son nom l'indique, Ngx-Videogular est un framework multimédia créé dans Angular.
À l'aide de quelques balises et attributs ajoutés à votre code HTML, vous pouvez créer votre lecteur vidéo personnalisé à l'aide de Ngx-Videogular, qui s'appuie principalement sur les normes HTML5.
La conception suivante vous traverse probablement l'esprit : pourquoi utiliser Angular pour la vidéo plutôt qu'un lecteur vidéo HTML5 ? Je suppose que nous pourrions répondre à cela en utilisant les fonctionnalités de Videogular. Eh bien, vous voyez, Ngx-Videogular est livré avec des fonctionnalités intrinsèques qui conviennent le mieux aux applications angulaires. Ces fonctionnalités sont livrées avec des options de lecteur vidéo HTML5 prédéfinies pour contrôler la vidéo.
Vous pouvez créer une application vidéo angulaire évolutive et bénéficier de plusieurs avantages en utilisant le plugin Ngx-Videogular :
Voyons comment nous pouvons implémenter un lecteur vidéo Ngx-Videogular dans notre application Angular.
ng new angular-videoplayer-app
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS
cd angular-videoplayer-app
npm install @videogular/ngx-videogular --save
npm install @types/core-js --save-dev
"styles": [
"node_modules/@videogular/ngx-videogular/fonts/videogular.css",
"styles.scss"
],
//app.module.ts//
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {VgCoreModule} from '@videogular/ngx-videogular/core';
import {VgControlsModule} from '@videogular/ngx-videogular/controls';
import {VgOverlayPlayModule} from '@videogular/ngx-videogular/overlay-play';
import {VgBufferingModule} from '@videogular/ngx-videogular/buffering';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
VgCoreModule,
VgControlsModule,
VgOverlayPlayModule,
VgBufferingModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
<h3>Basic Video Player</h3>
<vg-player>
<video [vgMedia]="$any(media)" #media id="singleVideo" preload="auto" controls>
<source src=" " type="video/mp4">
</video>
</vg-player>
C'est trop simple, et il n'y a rien à voir ici. Mais que se passe-t-il si nous ajoutons un lien vers notre source vidéo ci-dessous ?
<vg-player>
<video [vgMedia]="$any(media)" #media id="singleVideo" preload="auto" controls>
<source src="http://static.videogular.com/assets/videos/videogular.mp4" type="video/mp4">
</video>
</vg-player>
C'est bien, mais si nous voulons ajouter quelques fonctionnalités pour le rendre pratique, nous devrions ajouter des contrôles personnalisés pour le peaufiner correctement.
L'intégration de divers composants permet au lecteur vidéo Videogular d'offrir des commandes de lecteur spécialisées telles que le contrôle de la vitesse, l'état, les boutons de lecture/pause, le tampon vidéo et la barre de lecture, ainsi que les boutons de sourdine et de volume. Ajoutez les éléments suivants au modèle de composant d'application pour créer les commandes personnalisées du lecteur vidéo.
<div>
<h3>Basic Video Player</h3>
<vg-player>
<vg-overlay-play></vg-overlay-play>
<vg-buffering></vg-buffering>
<vg-scrub-bar>
<vg-scrub-bar-current-time></vg-scrub-bar-current-time>
<vg-scrub-bar-buffering-time></vg-scrub-bar-buffering-time>
</vg-scrub-bar>
<vg-controls>
<vg-play-pause></vg-play-pause>
<vg-playback-button></vg-playback-button>
<vg-time-display vgProperty="current" vgFormat="mm:ss"></vg-time-display>
<vg-scrub-bar style="pointer-events: none;"></vg-scrub-bar>
<vg-time-display vgProperty="left" vgFormat="mm:ss"></vg-time-display>
<vg-time-display vgProperty="total" vgFormat="mm:ss"></vg-time-display>
<vg-track-selector></vg-track-selector>
<vg-mute></vg-mute>
<vg-volume></vg-volume>
<vg-fullscreen></vg-fullscreen>
</vg-controls>
<video [vgMedia]="$any(media)" #media id="singleVideo" preload="auto" crossorigin>
<source src="http://static.videogular.com/assets/videos/videogular.mp4" type="video/mp4">
<track kind="subtitles" label="English" src="http://static.videogular.com/assets/subs/pale-blue-dot.vtt" srclang="en" default>
<track kind="subtitles" label="Español" src="http://static.videogular.com/assets/subs/pale-blue-dot-es.vtt" srclang="es">
</video>
</vg-player>
</div>
Cela fournira un lecteur vidéo avec une disposition et des icônes personnalisées uniques.
Ce que nous allons faire est de mettre à jour le app.component.tsavec l'objet Playlist et les méthodes Player
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'angular-videoplayer-app';
playlist = [
{
title: 'Agent 327!',
src: 'https://media.vimejs.com/720p.mp4',
type: 'video/mp4'
},
{
title: 'Big Buck Bunny',
src: 'http://static.videogular.com/assets/videos/big_buck_bunny_720p_h264.mov',
type: 'video/mp4'
},
{
title: 'Messi Goal',
src: 'http://static.videogular.com/assets/videos/goal-2.mp4',
type: 'video/mp4'
}
];
currentIndex = 0;
activeVideo = this.playlist[this.currentIndex];
api!: { getDefaultMedia: () => { (): any; new(): any; subscriptions: { (): any; new(): any; loadedMetadata: { (): any; new(): any; subscribe: { (arg0: () => void): void; new(): any; }; }; ended: { (): any; new(): any; subscribe: { (arg0: () => void): void; new(): any; }; }; }; }; play: () => void; };
constructor() {
}
onPlayerSet(api: any) {
this.api = api;
this.api.getDefaultMedia().subscriptions.loadedMetadata.subscribe(this.startVideo.bind(this));
this.api.getDefaultMedia().subscriptions.ended.subscribe(this.nextVideo.bind(this));
}
nextVideo() {
this.currentIndex++;
if (this.currentIndex === this.playlist.length) {
this.currentIndex = 0;
}
this.activeVideo = this.playlist[this.currentIndex];
}
startVideo() {
this.api.play();
}
onClickPlaylistVideo(item: { title: string; src: string; type: string; }, index: number) {
this.currentIndex = index;
this.activeVideo = item;
}
}
Mettez à jour les app.component.htmlécouteurs d'événement avec pour ajouter une liste de lecture sous le lecteur vidéo.
<div>
<h3>Basic Video Player</h3>
<vg-player>
...
...
<video [vgMedia]="$any(media)" #media [src]="activeVideo.src" id="singleVideo" preload="auto" crossorigin>
</video>
</vg-player>
<ul>
<li class="playlist-item" *ngFor="let video of playlist; let $index = index"
(click)="onClickPlaylistVideo(video, $index)" [class.selected]="video === activeVideo">
{{ video.title }}
</li>
</ul>
</div>
Le lecteur avec la liste de lecture apparaîtra comme suit :
Alors c'est tout; le didacticiel Angular Video Player est maintenant terminé. Ce guide a couvert le meilleur plugin de lecteur vidéo pour les applications angulaires afin d'incorporer un lecteur vidéo avec des commandes personnalisées. Pour le code source, veuillez cliquer sur le lien Github .
Lien : https://blog.openreplay.com/playing-videos-in-angular-with-ngx-videogular
#angular #javascript