之前分享过苹果cms整合DPLAYER和CKPLAYER播放器的教程,[苹果CMSV10教程]CKplayer、DPlayer本地调用m3u8解析使用方法今天分享一个单独增加自动下一集功能。
苹果cms网站根目录下的static/player/dplayer.html文件
查找
try{
在以上代码前插入以下代码
dp.on('ended', function (){ if(parent.MacPlayer.PlayLinkNext!=''){ top.location.href = parent.MacPlayer.PlayLinkNext; } });
你采集的资源站M3U8地址的话,可以使用本地DPLAYER的
把资源站JS的播放器代码替换为:
MacPlayer.Html = '<iframe border="0" src="'+maccms.path+'/dplayer.html" width="100%" height="100%" marginWidth="0" frameSpacing="0" marginHeight="0" frameBorder="0" scrolling="no" vspale="0" allowfullscreen="true" noResize></iframe>';MacPlayer.Show();
以上 代码通用M3U8和MP4的播放地址!
如果需要使用CK自动下一集的话可以把JS代码替换为:
MacPlayer.Html = '<iframe border="0" src="'+maccms.path+'/ckplayer.html" width="100%" height="100%" marginWidth="0" frameSpacing="0" marginHeight="0" frameBorder="0" scrolling="no" vspale="0" allowfullscreen="true" noResize></iframe>';MacPlayer.Show();