我在Android / iOS上播放Brightcove视频时遇到了问题。 在桌面上工作的相同代码无法在移动设备上运行。
有没有人知道为什么会发生这种情况?
我在此链接中找到的用于测试目的的代码 - > https://gist.github.com/bcls/7535049
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Smart Player API: Basic Setup</title>
</head>
<body>
<!-- Start of Brightcove Player -->
<div style="display:none">
</div>
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience922656010001" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="2344262015001" />
<param name="playerKey" value="AQ~~,AAAA1oy1bvE~,ALl2ezBj3WHB4SZjVHPI3HSdWBlOCXX4" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="@videoPlayer" value="922656010001" />
<!-- smart player api params -->
<param name="includeAPI" value="true" />
<param name="templateLoadHandler" value="onTemplateLoad" />
<param name="templateReadyHandler" value="onTemplateReady" />
</object>
<!--
This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.
-->
<script type="text/javascript">brightcove.createExperiences();</script>
<!-- End of Brightcove Player -->
<script type="text/JavaScript">
var player,
APIModules,
videoPlayer;
function onTemplateLoad(experienceID){
player = brightcove.api.getExperience(experienceID);
APIModules = brightcove.api.modules.APIModules;
}
function onTemplateReady(evt){
videoPlayer = player.getModule(APIModules.VIDEO_PLAYER);
videoPlayer.play();
}
</script>
</body>
</html>
答案 0 :(得分:1)
无法在移动设备中自动触发播放或全屏等事件,因为这些事件需要客户互动。代码是正确的,但由于玩家的技术属性,事件无法触发。
在下面的链接中,您可以找到有关BC的已知问题列表,例如移动设备上的视频播放。
我希望它可能有用
答案 1 :(得分:0)
它的回复很晚但我的项目设置中存在问题,当我尝试将其作为独立运行时。它工作正常。因此,如果您的项目中出现此问题,请尝试在独立项目中运行它。