html5 player ios,html - Dailymotion embedded player on iOS devices (HTML5) - Stack Overflow

这篇博客讲述了作者在使用Dailymotion的JavaScript SDK创建一个视频播放器时遇到的问题。在桌面和Android设备上,播放器工作正常,但在iOS设备上,视频无法开始。代码示例展示了如何异步加载SDK并初始化播放器,以及尝试在API准备就绪后播放视频的事件监听器。问题可能与iOS设备上的浏览器限制或SDK的兼容性有关。
摘要由CSDN通过智能技术生成

I have a Dailymotion embedded player using the Player api ( http://www.dailymotion.com/doc/api/player.html ) . It works well on a Desktop and a Android Tablet. But on a iOS device, the video just doesn't start. My code is as follows:

// This code loads the Dailymotion Javascript SDK asynchronously.

(function() {

var e = document.createElement('script'); e.async = true;

e.src = document.location.protocol + '//api.dmcdn.net/all.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);

}());

// This function init the player once the SDK is loaded

window.dmAsyncInit = function()

{

// PARAMS is a javascript object containing parameters to pass to the player if any (eg: {autoplay: 1})

var player = DM.player("player", {video: 'somevideoid', width: "100%", height: "100%", params: {autoplay: 0}});

// 4. We can attach some events on the player (using standard DOM events)

player.addEventListener("apiready", function(e)

{

e.target.play();

});

};

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值