Azure Media Player在悬停或鼠标悬停时显示控件

时间:2018-05-08 18:20:10

标签: azure-media-services

我的jQuery解决方案有效,但它有点hacky。文档缺乏信息和示例。

文档:https://amp.azure.net/libs/amp/latest/docs/index.html#amp.player.controls

我的解决方案:

$(".azuremediaplayer").hover(function () {
    $(".vjs-control-bar").css({
        "visibility": "visible",
        "opacity": "1"
    })
}, function () {
    $(".vjs-control-bar").css({
        "visibility": "hidden",
         "opacity": "0"
    })
})

1 个答案:

答案 0 :(得分:0)

根据您的要求,您可以采用以下方法:

amp.player.options.controls

var myOptions = {
"nativeControlsForTouch": true,
controls: true, //set to true
autoplay: true,
width: "640",
height: "400",
}
myPlayer = amp("azuremediaplayer", myOptions);
myPlayer.src([
  {"src":"https://sec.ch9.ms/ch9/cf2b/d75f604a-e59f-46f2-81d3-4ec1473ecf2b/AzureFridayGetStartedWithAzureFor_mid.mp4"}
]);

amp.player.controls

myPlayer = amp("azuremediaplayer", myOptions);
myPlayer.controls(true);

此外,为了更简单,您可以访问here来自定义您的设置并获取播放器代码。