Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into test

This commit is contained in:
Yuan 2022-09-27 18:11:47 +08:00
commit fe20f16b70
2 changed files with 36 additions and 9 deletions

View File

@ -4,7 +4,7 @@
<div v-if="lineCode == '07'" id="jlReal3d" class="jlReal3d"> <div v-if="lineCode == '07'" id="jlReal3d" class="jlReal3d">
<div class="realCctv1"> <div class="realCctv1">
<video id="myvideo0" class="video-js"> <video id="myvideo0" class="video-js">
<source src="http://160.20.60.15/hls/cctv2.m3u8" type="application/x-mpegURL"> <source src="http://160.20.60.15/hls/cctv1.m3u8" type="application/x-mpegURL">
</video> </video>
</div> </div>
<div class="realCctv2"> <div class="realCctv2">
@ -112,7 +112,7 @@ export default {
{ {
controls: false, controls: false,
autoplay: 'muted', autoplay: 'muted',
loop: true, loop: false,
preload: 'auto', preload: 'auto',
width: window.innerWidth / 4 + 'px', width: window.innerWidth / 4 + 'px',
height: window.innerHeight / 2 + 'px', height: window.innerHeight / 2 + 'px',
@ -122,20 +122,36 @@ export default {
}, },
function () { function () {
console.log('videojs播放器初始化成功'); console.log('videojs播放器初始化成功');
const video = this;
// this.on('loadstart', function() {
// //
// console.log('loadstart');
// });
this.on('loadeddata', function() {
console.log('loadeddata');
});
this.on('seeked', function() {
// ,
console.log('seeked');
video.play();
});
this.on('loadedmetadata', function() { this.on('loadedmetadata', function() {
console.log('loadedmetadata'); console.log('loadedmetadata');
// //
// startVideo(); // startVideo();
video.autoplay(true);
var lastTime = -1; var lastTime = -1;
// var tryTimes = 0; // var tryTimes = 0;
let isVideoBreak = null; let isVideoBreak = null;
clearInterval(isVideoBreak); clearInterval(isVideoBreak);
isVideoBreak = setInterval(function() { isVideoBreak = setInterval(function() {
var currentTime = videoPlay.currentTime(); // debugger;
var currentTime = video.currentTime();
console.log('currentTime' + currentTime + 'lastTime' + lastTime); console.log('currentTime' + currentTime + 'lastTime' + lastTime);
if (currentTime == lastTime) { if (currentTime == lastTime) {
videoPlay.currentTime(currentTime + 10000); video.currentTime(currentTime + 10000);
videoPlay.play(); video.play();
// video.autoplay(true);
// // 5 // // 5
// if (++tryTimes > 5) { // if (++tryTimes > 5) {
// alert(''); // alert('');

View File

@ -42,7 +42,7 @@ export default {
const videoPlay = new Video('myvideo' + i, { const videoPlay = new Video('myvideo' + i, {
controls: false, controls: false,
autoplay: 'muted', autoplay: 'muted',
loop:true, loop: false,
preload: 'auto', preload: 'auto',
width: window.innerWidth / 2 + 'px', width: window.innerWidth / 2 + 'px',
height: window.innerHeight + 'px', height: window.innerHeight + 'px',
@ -51,20 +51,31 @@ export default {
} }
}, function () { }, function () {
console.log('videojs播放器初始化成功'); console.log('videojs播放器初始化成功');
const video = this;
this.on('loadeddata', function() {
console.log('loadeddata');
});
this.on('seeked', function() {
// ,
console.log('seeked');
video.play();
});
this.on('loadedmetadata', function() { this.on('loadedmetadata', function() {
console.log('loadedmetadata'); console.log('loadedmetadata');
// //
// startVideo(); // startVideo();
video.autoplay(true);
var lastTime = -1; var lastTime = -1;
// var tryTimes = 0; // var tryTimes = 0;
let isVideoBreak = null; let isVideoBreak = null;
clearInterval(isVideoBreak); clearInterval(isVideoBreak);
isVideoBreak = setInterval(function() { isVideoBreak = setInterval(function() {
var currentTime = videoPlay.currentTime(); // debugger;
var currentTime = video.currentTime();
console.log('currentTime' + currentTime + 'lastTime' + lastTime); console.log('currentTime' + currentTime + 'lastTime' + lastTime);
if (currentTime == lastTime) { if (currentTime == lastTime) {
videoPlay.currentTime(currentTime + 10000); video.currentTime(currentTime + 10000);
videoPlay.play(); video.play();
// // 5 // // 5
// if (++tryTimes > 5) { // if (++tryTimes > 5) {
// alert(''); // alert('');