本文介绍了Azure Media Player在重新访问视图时未在Angular JS中播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的angularjs应用程序中使用了Azure媒体播放器,并且能够观看视频.但是在重新访问存在视频标签的视图时,不是在播放视频,而是在后台播放音频.

I have consumed the azure media player in my angularjs application and able to view the video. But on revisit the same view where the video tag present, not playing the video, but audio is playing in the background.

我正在使用ui-router进行路由.

I am using ui-router for routing.

在此先感谢您的快速帮助.

Thanks in advance for a quick help.

这是我观看视频的js代码

Here is my angular js code to view the video

    var myOptions = {
"nativeControlsForTouch": false,
controls: true,
autoplay: false,
width: "640",
height: "400",
}
var myPlayer = amp("azuremediaplayer", myOptions);
myPlayer.src([
    {
            "src": 
  "//amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-
   faba6c2206a2/AzureMediaServicesPromo.ism/manifest",
            "type": "application/vnd.ms-sstr+xml"

    }
]);
amp("azuremediaplayer").ready(function(){
 var myPlayer = this;


 myPlayer.play();
});

 **HTML tag**
 <video id="azuremediaplayer" class="azuremediaplayer amp-default-skin amp-
   big-play-centered" tabindex="0"></video>

推荐答案

在使用Azure Media Player时,我也面临同样的问题.将播放器置于关闭窗口后,该问题将得到解决.

I also face the same issue while using azure media player.After dispose the player on closing window will get resolved this issue.

myPlayer = amp("azuremediaplayer", {
                        "nativeControlsForTouch": false,
                        controls: true,
                        autoplay: true
                    })
myPlayer.dispose();

这篇关于Azure Media Player在重新访问视图时未在Angular JS中播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 13:39