【发布时间】:2016-08-08 16:35:32
【问题描述】:
我正在尝试在我的网页中播放嵌入视频,在桌面浏览器中没有问题,但在移动版本中我有这些问题:
- 视频不会自动开始
- 右下角有 Dailymotion 标志
我正在使用文件https://api.dmcdn.net/all.js提供的DM对象。
代码:
<script src="https://api.dmcdn.net/all.js"></script>
<script>
DM.init({
apiKey: 'correct api key',
status: true, // check login status
cookie: true // enable cookies to allow the server to access the session
});
</script>
<div id="player{$img->getId()}" class="dailymotion tile"></div>
<script>
$(function () {
var player{$img->getId()} = DM.player(document.getElementById("player{$img->getId()}"), {
{var DMurl = explode("/", $img->getImgUrl())}
video: {$DMurl[count($DMurl) - 1]},
width: "100%",
height: "100%",
params: {
autoplay: true,
mute: true,
endscreen-enable: false,
ui-logo: true,
controls: false
}
});
player{$img->getId()}.play();
});
</script>
我的问题可能是由 params 中的语法错误引起的(endscreen-enable 和 ui-logo,phpstorm 由于 '-' 字符而显示语法错误)
【问题讨论】:
标签: dailymotion-api