【问题标题】:dailymotion api mobile website issuesdailymotion api 移动网站问题
【发布时间】: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


    【解决方案1】:
    • 视频不会自动开始 => 这在移动设备上很正常,对于您从任何提供商添加的任何视频都是一样的。原因是大多数移动设备都无法自动播放视频,因此播放必须由用户交互触发。这在 Dailymotion 开发者网站上有详细说明:https://developer.dailymotion.com/player/faq#player-faq-autoplay-does-not-work-on-mobile

    • 右下角有 Dailymotion 标志 => 你通过了ui-logo: true,所以这很正常!

    【讨论】:

      猜你喜欢
      • 2013-01-31
      • 2011-11-14
      • 2011-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-02
      • 1970-01-01
      • 2018-10-09
      相关资源
      最近更新 更多