简体   繁体   English

是否可以使用其 javascript API 为 azure 媒体播放器选择质量?

[英]Is it possible to select a quality for the azure media player using its javascript API?

Looking to implement azure media player for a project.希望为项目实施 azure 媒体播放器。 But we need to use our existing custom video controls.但是我们需要使用我们现有的自定义视频控件。 Is it possible to control the quality selector by javascript?是否可以通过 javascript 控制质量选择器? Have not been able to find anything concerning this in the documentation..无法在文档中找到与此相关的任何内容..

Does anyone have experience with this?有任何人对此有经验吗?

Any help would be appreciated!任何帮助,将不胜感激!

Could also be worth noting that this is a react.js project.还值得注意的是,这是一个 react.js 项目。

Thanks,谢谢,

You can specify the heuristic profile (HighQuality, Hybrid, LowLatency, QuickStart):您可以指定启发式配置文件(HighQuality、Hybrid、LowLatency、QuickStart):

http://amp.azure.net/libs/amp/latest/docs/index.html#amp.player.heuristicprofile http://amp.azure.net/libs/amp/latest/docs/index.html#amp.player.heuristicprofile

http://amp.azure.net/libs/amp/latest/docs/#amp.videostream.selecttrackbyindex http://amp.azure.net/libs/amp/latest/docs/#amp.videostream.selecttrackbyindex

try something like this:尝试这样的事情:

myPlayer.addEventListener(amp.eventName.loadedmetadata,
    function() {

        var stream = myPlayer.currentVideoStreamList().streams ?
            myPlayer.currentVideoStreamList().streams[0] :
            undefined;

        if (stream) {
            stream.selectTrackByIndex(0);
        }

    });



myPlayer.src([{
    src: "[srcuri]",
    type: "application/vnd.ms-sstr+xml"
}]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM