$(data).each(function(i, item) { // innerhtml += '<li type-id="'+item.id+'">'+ // '<img src="'+(item.imgs?item.imgs:'../../img/videobg1.jpg')+'" alt="">'+ // '<p>'+item.name+'</p>'+ // '</li>'; innerhtml += '<li type-id="' + item.id + '">' + // '<img src="'+(item.imgs?item.imgs:'../../img/videobg1.jpg')+'" alt="">'+ '<video style="width:100%;height:100%;" id="example_video_' + item.id + '" class="videoclass video-js vjs-default-skin vjs-big-play-centered" autoplay="autoplay" controls muted><source src="' + item.hls + '" type="application/x-mpegurl">' + '</video>' + '<p>' + item.name + '</p>' + '</li>'; //视频实时播放 settimeout(function() { var myplayer = videojs('example_video_' + item.id); videojs('example_video_' + item.id).ready(function() { var myplayer = this; myplayer.play(); }); }, 5000); });
引入video.css 和video.js 为前提
调用主要是
settimeout(function() { var myplayer = videojs('example_video_' + item.id); videojs('example_video_' + item.id).ready(function() { var myplayer = this; myplayer.play(); }); }, 5000);
需要做个延时,避免加载失败
如对本文有疑问, 点击进行留言回复!!
asp.net中ajax和一般处理程序(handler.ashx)的交互
egg.js创建项目,目录介绍,简单使用,sequelize mysql使用
网友评论