Commit bb5c7c3e authored by Tt's avatar Tt

测试报错点

parent fafe14e5
......@@ -418,77 +418,77 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.videoPlayer.node.x = -10000;
this.videoPlayer.node.y = -10000;
this.layout_video.active = false;
this.videoPlayer.node.on('ready-to-play', () => {
console.log('ready-to-play');
this._isReadyToPlay = true;
this._isPlayComplated = false;
this.videoPlayer.currentTime = 0;
});
this.videoPlayer.node.on('meta-loaded', () => {
console.log('meta-loaded');
});
this.videoPlayer.node.on('clicked', () => {
if (!this.node) return;
if (!this.videoPlayer) return;
if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = true;
this.videoControls.active = true;
if (this.time1) {
clearTimeout(this.time1);
}
this.time1 = setTimeout(() => {
if (!this.node) return;
if (!this.videoPlayer) return;
if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = false;
this.videoControls.active = false;
}, 6000);
});
this.videoPlayer.node.on('touchstart', () => {
if (!this.node) return;
if (!this.videoPlayer) return;
if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = true;
this.videoControls.active = true;
if (this.time1) {
clearTimeout(this.time1);
}
this.time1 = setTimeout(() => {
if (!this.node) return;
if (!this.videoPlayer) return;
if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = false;
this.videoControls.active = false;
}, 6000);
});
this.videoPlayer.node.on('playing', () => {
this.playButton.active = false;
this.pauseButton.active = true;
});
this.videoPlayer.node.on('paused', () => {
console.log('paused');
this.playButton.active = true;
this.pauseButton.active = false;
});
this.videoPlayer.node.on('stopped', () => {
console.log('stopped');
this.playButton.active = true;
this.pauseButton.active = false;
});
this.videoPlayer.node.on('completed', async () => {
console.log('completed');
this._isPlayComplated = true;
this.playButton.active = false;
this.pauseButton.active = false;
// 循环播放下一个
this.hideVideo();
});
cc.view.setResizeCallback((params) => {
console.log('Resize', params);
this.initdDrag()
});
this.initdDrag();
// this.videoPlayer.node.on('ready-to-play', () => {
// console.log('ready-to-play');
// this._isReadyToPlay = true;
// this._isPlayComplated = false;
// this.videoPlayer.currentTime = 0;
// });
// this.videoPlayer.node.on('meta-loaded', () => {
// console.log('meta-loaded');
// });
// this.videoPlayer.node.on('clicked', () => {
// if (!this.node) return;
// if (!this.videoPlayer) return;
// if (!this.layout_video) return;
// this.videoPlayer.stayOnBottom = true;
// this.videoControls.active = true;
// if (this.time1) {
// clearTimeout(this.time1);
// }
// this.time1 = setTimeout(() => {
// if (!this.node) return;
// if (!this.videoPlayer) return;
// if (!this.layout_video) return;
// this.videoPlayer.stayOnBottom = false;
// this.videoControls.active = false;
// }, 6000);
// });
// this.videoPlayer.node.on('touchstart', () => {
// if (!this.node) return;
// if (!this.videoPlayer) return;
// if (!this.layout_video) return;
// this.videoPlayer.stayOnBottom = true;
// this.videoControls.active = true;
// if (this.time1) {
// clearTimeout(this.time1);
// }
// this.time1 = setTimeout(() => {
// if (!this.node) return;
// if (!this.videoPlayer) return;
// if (!this.layout_video) return;
// this.videoPlayer.stayOnBottom = false;
// this.videoControls.active = false;
// }, 6000);
// });
// this.videoPlayer.node.on('playing', () => {
// this.playButton.active = false;
// this.pauseButton.active = true;
// });
// this.videoPlayer.node.on('paused', () => {
// console.log('paused');
// this.playButton.active = true;
// this.pauseButton.active = false;
// });
// this.videoPlayer.node.on('stopped', () => {
// console.log('stopped');
// this.playButton.active = true;
// this.pauseButton.active = false;
// });
// this.videoPlayer.node.on('completed', async () => {
// console.log('completed');
// this._isPlayComplated = true;
// this.playButton.active = false;
// this.pauseButton.active = false;
// // 循环播放下一个
// this.hideVideo();
// });
// cc.view.setResizeCallback((params) => {
// console.log('Resize', params);
// this.initdDrag()
// });
// this.initdDrag();
}
initdDrag() {
......@@ -534,6 +534,61 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.updateBarByPos(this.barTag.x);
});
}
onVideoPlayerEvent(sender, event) {
cc.log(event)
if (event === cc.VideoPlayer.EventType.CLICKED) {
}
else if (event === cc.VideoPlayer.EventType.READY_TO_PLAY || event === cc.VideoPlayer.EventType.META_LOADED) {
}
else if (event === cc.VideoPlayer.EventType.PLAYING) {
cc.log("=========")
cc.log(sender);
cc.log(sender._impl._h)
cc.log(sender._impl._w);
if (sender?._impl?._w) {
// this.vplayer.node.scale = cc.winSize.width / sender._impl._w;
}
}
else if (event === cc.VideoPlayer.EventType.COMPLETED) {
this._isPlayComplated = true;
this.playButton.active = false;
this.pauseButton.active = false;
// 循环播放下一个
this.hideVideo();
// this.videoCtrl.active = false;
// this.node.getChildByName("bg").active = true;
// cc.log("video completed");
// this.boyNode.active = true;
// this.vplayer.node.active = false;
// if (this.WrongList.length > 0) {
// this.initWorongLogic();
// } else {
// this.boyNode.getComponent(Boy).playtalk(-1);
// this.playAudioByUrl(this.data.audio_url_end, () => {
// this.boyNode.getComponent(Boy).playWave(-1);
// this.btn_next.active = true;
// })
// }
}
}
updateBarByPos(newX) {
const maxX = this.ProgressBar.width;
const minX = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment