0

Looking to implement azure media player for a project. But we need to use our existing custom video controls. Is it possible to control the quality selector by 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.

Thanks,

4

1 回答 1

1

您可以指定启发式配置文件(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/#amp.videostream.selecttrackbyindex

尝试这样的事情:

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"
}]);
于 2020-03-23T18:48:49.040 回答