Commit bb5c7c3e authored by Tt's avatar Tt

测试报错点

parent fafe14e5
...@@ -418,77 +418,77 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -418,77 +418,77 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.videoPlayer.node.x = -10000; this.videoPlayer.node.x = -10000;
this.videoPlayer.node.y = -10000; this.videoPlayer.node.y = -10000;
this.layout_video.active = false; this.layout_video.active = false;
this.videoPlayer.node.on('ready-to-play', () => { // this.videoPlayer.node.on('ready-to-play', () => {
console.log('ready-to-play'); // console.log('ready-to-play');
this._isReadyToPlay = true; // this._isReadyToPlay = true;
this._isPlayComplated = false; // this._isPlayComplated = false;
this.videoPlayer.currentTime = 0; // this.videoPlayer.currentTime = 0;
}); // });
this.videoPlayer.node.on('meta-loaded', () => { // this.videoPlayer.node.on('meta-loaded', () => {
console.log('meta-loaded'); // console.log('meta-loaded');
}); // });
this.videoPlayer.node.on('clicked', () => { // this.videoPlayer.node.on('clicked', () => {
if (!this.node) return; // if (!this.node) return;
if (!this.videoPlayer) return; // if (!this.videoPlayer) return;
if (!this.layout_video) return; // if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = true; // this.videoPlayer.stayOnBottom = true;
this.videoControls.active = true; // this.videoControls.active = true;
if (this.time1) { // if (this.time1) {
clearTimeout(this.time1); // clearTimeout(this.time1);
} // }
this.time1 = setTimeout(() => { // this.time1 = setTimeout(() => {
if (!this.node) return; // if (!this.node) return;
if (!this.videoPlayer) return; // if (!this.videoPlayer) return;
if (!this.layout_video) return; // if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = false; // this.videoPlayer.stayOnBottom = false;
this.videoControls.active = false; // this.videoControls.active = false;
}, 6000); // }, 6000);
}); // });
this.videoPlayer.node.on('touchstart', () => { // this.videoPlayer.node.on('touchstart', () => {
if (!this.node) return; // if (!this.node) return;
if (!this.videoPlayer) return; // if (!this.videoPlayer) return;
if (!this.layout_video) return; // if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = true; // this.videoPlayer.stayOnBottom = true;
this.videoControls.active = true; // this.videoControls.active = true;
if (this.time1) { // if (this.time1) {
clearTimeout(this.time1); // clearTimeout(this.time1);
} // }
this.time1 = setTimeout(() => { // this.time1 = setTimeout(() => {
if (!this.node) return; // if (!this.node) return;
if (!this.videoPlayer) return; // if (!this.videoPlayer) return;
if (!this.layout_video) return; // if (!this.layout_video) return;
this.videoPlayer.stayOnBottom = false; // this.videoPlayer.stayOnBottom = false;
this.videoControls.active = false; // this.videoControls.active = false;
}, 6000); // }, 6000);
}); // });
this.videoPlayer.node.on('playing', () => { // this.videoPlayer.node.on('playing', () => {
this.playButton.active = false; // this.playButton.active = false;
this.pauseButton.active = true; // this.pauseButton.active = true;
}); // });
this.videoPlayer.node.on('paused', () => { // this.videoPlayer.node.on('paused', () => {
console.log('paused'); // console.log('paused');
this.playButton.active = true; // this.playButton.active = true;
this.pauseButton.active = false; // this.pauseButton.active = false;
}); // });
this.videoPlayer.node.on('stopped', () => { // this.videoPlayer.node.on('stopped', () => {
console.log('stopped'); // console.log('stopped');
this.playButton.active = true; // this.playButton.active = true;
this.pauseButton.active = false; // this.pauseButton.active = false;
}); // });
this.videoPlayer.node.on('completed', async () => { // this.videoPlayer.node.on('completed', async () => {
console.log('completed'); // console.log('completed');
this._isPlayComplated = true; // this._isPlayComplated = true;
this.playButton.active = false; // this.playButton.active = false;
this.pauseButton.active = false; // this.pauseButton.active = false;
// 循环播放下一个 // // 循环播放下一个
this.hideVideo(); // this.hideVideo();
}); // });
cc.view.setResizeCallback((params) => { // cc.view.setResizeCallback((params) => {
console.log('Resize', params); // console.log('Resize', params);
this.initdDrag() // this.initdDrag()
}); // });
this.initdDrag(); // this.initdDrag();
} }
initdDrag() { initdDrag() {
...@@ -534,6 +534,61 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -534,6 +534,61 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.updateBarByPos(this.barTag.x); 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) { updateBarByPos(newX) {
const maxX = this.ProgressBar.width; const maxX = this.ProgressBar.width;
const minX = 0; 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