Crypto Like

Crypto Like

1619962776

What is Media Network (MEDIA) | What is Media Network token | What is MEDIA token

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 Network App

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

How and Where to Buy MEDIA token ?

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)…

SIGN UP ON BINANCE

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

WebsiteExplorerSocial ChannelSocial Channel 2Coinmarketcap

🔺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

What is GEEK

Buddha Community

What is Media Network (MEDIA) | What is Media Network token | What is MEDIA token
Crypto Like

Crypto Like

1619962776

What is Media Network (MEDIA) | What is Media Network token | What is MEDIA token

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 Network App

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

How and Where to Buy MEDIA token ?

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)…

SIGN UP ON BINANCE

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

WebsiteExplorerSocial ChannelSocial Channel 2Coinmarketcap

🔺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

Stratus seo

Stratus seo

1625816471

Stratus: One of the best social media posting tools for efficient social media management

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

Royce  Reinger

Royce Reinger

1658068560

WordsCounted: A Ruby Natural Language Processor

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.

Features

  • Out of the box, get the following data from any string or readable file, or URL:
    • Token count and unique token count
    • Token densities, frequencies, and lengths
    • Char count and average chars per token
    • The longest tokens and their lengths
    • The most frequent tokens and their frequencies.
  • A flexible way to exclude tokens from the tokeniser. You can pass a string, regexp, symbol, lambda, or an array of any combination of those types for powerful tokenisation strategies.
  • Pass your own regexp rules to the tokeniser if you prefer. The default regexp filters special characters but keeps hyphens and apostrophes. It also plays nicely with diacritics (UTF and unicode characters): Bayrūt is treated as ["Bayrūt"] and not ["Bayr", "ū", "t"], for example.
  • Opens and reads files. Pass in a file path or a url instead of a string.

Installation

Add this line to your application's Gemfile:

gem 'words_counted'

And then execute:

$ bundle

Or install it yourself as:

$ gem install words_counted

Usage

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.

API

WordsCounted

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.

Tokeniser

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.

Counter

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

Excluding tokens from the tokeniser

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.

  1. A space-delimited string. The filter will normalise the string.
  2. A regular expression.
  3. A lambda.
  4. A symbol that names a predicate method. For example :odd?.
  5. An array of any combination of the above.
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}, "و"]
)
# => ["هي", "سامي", "وداني"]

Passing in a custom regexp

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"]

Opening and reading files

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")

Gotchas

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.

A note on case sensitivity

The program will normalise (downcase) all incoming strings for consistency and filters.

Roadmap

Ability to open URLs

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.

Gem Version 

RubyDoc documentation.

Demo

Visit this website for one example of what you can do with WordsCounted.


Contributors

See contributors.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author: Abitdodgy
Source Code: https://github.com/abitdodgy/words_counted 
License: MIT license

#ruby #nlp 

Hong  Nhung

Hong Nhung

1662360645

Cách Phát Video Trong ứng Dụng angular Với Ngx-Videogular

Trình phát video góc với Ngx-Videogular

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.

Các tính năng của Ngx-Videogular

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.

  • Phần tử web: Bạn có thể thiết kế và xây dựng trình phát của riêng mình mà không cần viết JavaScript. Bạn có thể viết mã bằng HTML và CSS.
  • TypeScript: Angular và các thư viện hỗ trợ của nó là các khung có cú pháp Typecript. Hệ sinh thái Typecript mạnh mẽ cho phép chúng tôi xác định lỗi và các vấn đề về kiến ​​trúc trước khi chúng trở nên nghiêm trọng.
  • Hỗ trợ đa nhà cung cấp: Khung phương tiện này hỗ trợ nhiều định dạng nội dung khác nhau, từ MP4 đến WEBM được sử dụng rộng rãi nhất. Đồng thời hỗ trợ nội dung âm thanh cũng như HTML5, HLS, YOUTUBE và nhiều nội dung khác.
  • Phân phối: Phân phối rất đơn giản vì Ngx-Videogular được xây dựng trên Angular, một khung công tác được yêu thích với một cộng đồng sôi động. Điều này giúp những người khác bắt đầu phát triển plugin hoặc sửa lỗi đơn giản hơn.

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:

  • Phát trực tiếp trong trình phát đa phương tiện.
  • Kiểm soát toàn bộ trình phát video.
  • Chạy các trình phát video khác nhau ở màn hình có liên quan.
  • hỗ trợ định dạng âm thanh

Cách thêm Trình phát video vào ứng dụng Angular của chúng tôi

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.

  • 1 Tạo ứng dụng Angular mới . Để bắt đầu một dự án Angular mới, hãy bắt đầu nglệnh sau.
ng new angular-videoplayer-app
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS
  • 2 Di chuyển đến thư mục dự án.
cd angular-videoplayer-app
  • 3 Cài đặt gói Ngx-Videogular Có thể cài đặt gói Ngx-Videogular bằng lệnh sau.
npm install @videogular/ngx-videogular --save
npm install @types/core-js --save-dev
  • 4 Nhập kiểu CSS ngx-videogular bây giờ phải được xác định trong angular.jsontệp. Chúng ta phải xác định vị trí của nó để sử dụng hình tượng và hình thức độc đáo của gói Videogular.
"styles": [
    "node_modules/@videogular/ngx-videogular/fonts/videogular.css",
    "styles.scss"
],
  • 5 Cập nhật mô-đun ứng dụng Bạn phải bao gồm mô-đun Videogular trong mô-đun ứng dụng của mình trước khi bạn có thể bắt đầu sử dụng Videogular trong dự án của mình. Mở app.module.tsvà nhập Mô-đun Videogular của chúng tôi.
//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 { }
  • 6 Cập nhật thành phần ứng dụng Đối với một trình phát video cơ bản, tất cả những gì chúng ta phải làm là thêm <vg-player>thành phần với <video>thẻ từ HTML5 mang chỉ thị `[vgMedia] =“ $ any (media) `` `.
<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>

1

Đ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>

2

Đ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.

Trình phát video với nhiều thành phần tùy chỉnh hơn

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.

3

Trình phát video với các chức năng nâng cao

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:

4

Sự kết luận

À 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

Thierry  Perret

Thierry Perret

1662367927

Comment Lire Des Vidéos Dans L'application angular Avec Ngx-Videogular

Lecteur vidéo angulaire avec Ngx-Videogular

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.

Caractéristiques de Ngx-Videogular

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.

  • Éléments Web : vous pouvez concevoir et créer votre propre lecteur sans écrire de JavaScript. Vous pouvez coder en HTML et CSS.
  • TypeScript : Angular et ses bibliothèques de support sont des frameworks syntaxés Typescript. Un écosystème fortement Typescript nous permet d'identifier les bogues et les problèmes d'architecture avant qu'ils ne deviennent sérieux.
  • Prise en charge multi-fournisseurs : ce framework multimédia prend en charge divers formats de contenu allant du MP4 le plus largement utilisé au WEBM. Prend également en charge le contenu audio ainsi que HTML5, HLS, YOUTUBE et bien d'autres.
  • Distribution : La distribution est simple puisque Ngx-Videogular est construit sur Angular, un cadre populaire avec une communauté dynamique. Cela permet aux autres de commencer facilement à développer des plugins ou à corriger des bugs.

Vous pouvez créer une application vidéo angulaire évolutive et bénéficier de plusieurs avantages en utilisant le plugin Ngx-Videogular :

  • Streaming en direct dans le lecteur multimédia.
  • Contrôle total du lecteur vidéo.
  • Exécutez divers lecteurs vidéo sur l'écran correspondant.
  • prendre en charge le format audio

Comment ajouter un lecteur vidéo à notre application angulaire

Voyons comment nous pouvons implémenter un lecteur vidéo Ngx-Videogular dans notre application Angular.

  • 1 Créer une nouvelle application angulaire . Pour démarrer un nouveau projet Angular, lancez la ngcommande suivante.
ng new angular-videoplayer-app
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS
  • 2 Accédez au répertoire du projet.
cd angular-videoplayer-app
  • 3 Installer le package Ngx-Videogular Le package Ngx-Videogular peut être installé avec la commande suivante.
npm install @videogular/ngx-videogular --save
npm install @types/core-js --save-dev
  • 4 Styles d'importation Le CSS ngx-videogular doit maintenant être défini dans le angular.jsonfichier. Nous devons définir son emplacement pour utiliser l'iconographie et l'apparence uniques du package Videogular.
"styles": [
    "node_modules/@videogular/ngx-videogular/fonts/videogular.css",
    "styles.scss"
],
  • 5 Mise à jour du module d'application Vous devez inclure le module Videogular dans votre module d'application avant de pouvoir commencer à utiliser Videogular dans votre projet. Ouvrez app.module.tset importez nos modules Videogular.
//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 { }
  • 6 Mettre à jour le composant de l'application Pour un lecteur vidéo de base, tout ce que nous avons à faire est d'ajouter un <vg-player>composant avec la <video>balise HTML5 portant la directive `[vgMedia]=“$any(media)```.
<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>

première

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>

2

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.

Lecteur vidéo avec plus de composants personnalisés

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.

3

Lecteur vidéo avec fonctions avancées

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 :

4

Conclusion

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