声音通道

  抱歉,这篇文章有英文版

Task: To organize the separation of the left and right channels in the player (stereo to mono).

Customer: «For example, there is a broadcast in two languages and we want to transmit one stream with different languages on the left and right channels, and in the player already to divide.»

Channel selection is enabled in the menu  Elements / Settings window

Also you need to enable Plugins / Channels with PRO

 

Channel selection will be in the settings menu. You can change all the names in the builder and remove the mixed (stereo) mode.

 

You can assign a default channel with the default_channel parameter in the player code.

0 left, 1 right, 2 stereo

var player = new Playerjs({id:"player", file:"stream.m3u8", default_channel:1});

Features and limitations

  • Channel switching works for video, audio files, for HLS and DASH.
  • Channel management requires cross-domain permission if content is loaded from another domain. Files may require server configuration — the header should contain Access-Control-Allow-Origin: * and the Services / Cross-domain (CORS) option is enabled in the settings. If the video plays muted, then something is wrong with the cross-domain policy (look in the browser console). For HLS and DASH streams everything is usually already set up and no manipulations are needed.
  • According to the rules of modern browsers, data processing requires user initiation. Therefore, the channel selection appears only after the user has launched the player.
  • Channel selection requires the browser to support the Web Audio API, so it may not work in older versions of browsers and Internet Explorer.
  • You can add custom elements for creating separate listing or switch channels using JS API with command api:channel,1

20.0.0
2024 © PlayerJS

登录

登录

免费注册

注册
注册即表示您同意服务条款
登录(如果您有帐户)

恢复密码

恢复
忘记电子邮件?联系我们