运行视频自动播放

时间:2016-04-04 23:49:06

标签: kaltura

我想为我的360视频添加自动播放功能。添加" autoplay = true"或"& autoplay = 1"对src没有帮助。

 <div class="row Video-row">
                    @if (!String.IsNullOrWhiteSpace(Model.Content.VideoID))
                    {
                        if (!Model.Content.VideoID.Contains("youtube"))
                        {
                            <div class="Video-ratioPusher"></div>
                            <script src="http://cdnapi.kaltura.com/p/1960461/sp/196046100/embedIframeJs/uiconf_id/@playerID/partner&autoplay=1_id/1960461?autoembed=true&entry_id=@Model.Content.VideoID&playerId=kaltura_player_@Model.Content.VideoID&cache_st=1459302170&maxwidth=0&maxheight=0&flashvars[streamerType]=auto&autoplay=1"></script>
                        }
                        else
                        {
                            <img class="Video-image" src="@Model.Content.BrandHtmlHelperExt.BrandAsset(this.Html, "images/player_logo_pink-480.png")" />
                            <div class="Video-ratioPusher"></div>    
                            <iframe class="kWidgetIframeContainer  kWidget.embed" src="@Model.Content.VideoID" frameborder="0" allowfullscreen></iframe>
                        }
                    }
                </div>

3 个答案:

答案 0 :(得分:0)

将autoplay = 1更改为autoplay = true

答案 1 :(得分:0)

用flashvars包装它: flashvars [autoPlay] = true

答案 2 :(得分:0)

再向flashvars添加一个参数,如下所示:

$now = strtotime('now');
$begin = new DateTime('tuesday this week');

$seconds_between_now_and_tuesday = (strtotime($begin) - strtotime($now));
$days_between_now_and_tuesday = $seconds_between_now_and_tuesday / 86400; //86,400 seconds in a day
if($days_between_now_and_tuesday < 7) {
    $begin = new DateTime('tuesday next week');
}