Commit 8abaa35e authored by 李维's avatar 李维

feat: 调整视频播放器的初始位置

parent a54a0333
{"ver":"1.1.2","uuid":"25d9df1c-9ef4-4af7-9a5f-6d461ebda6f1","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "25d9df1c-9ef4-4af7-9a5f-6d461ebda6f1",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
......@@ -300,7 +300,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-9999,
0,
0,
0,
......@@ -358,8 +358,8 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_left": -9999,
"_right": 9999,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
......
......@@ -545,6 +545,8 @@ cc.Class({
setTimeout(() => {
this.videoCanPlay = true;
if (window && window["air"] && this.pageLoaded) {
cc.find("Canvas/VideoPlayer").x = 0;
this.alignVideoPlayer();
window["air"].hideAirClassLoading();
}
}, 100);
......@@ -569,13 +571,12 @@ cc.Class({
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
console.log('preloadArr: ', JSON.stringify(preloadArr));
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
this.videoplayer.remoteURL = this.data.video_url;
this.addServerListener();
this.pageLoaded = true;
if (window && window["air"] && this.videoCanPlay) {
cc.find("Canvas/VideoPlayer").x = 0;
this.alignVideoPlayer();
window["air"].hideAirClassLoading();
}
});
......@@ -678,21 +679,8 @@ cc.Class({
}
},
initView() {
this.initBg();
alignVideoPlayer() {
const canvas = cc.find('Canvas')
this.videoplayer.node.on('ready-to-play', this.onReadyToPlay, this);
this.videoplayer.node.on('meta-loaded', this.onMetaLoaded, this);
this.videoplayer.node.on('clicked', this.onClicked, this);
this.videoplayer.node.on('playing', this.onPlaying, this);
// this.videoplayer.node.on('paused', this.onPaused, this);
// this.videoplayer.node.on('stopped', this.onStoped, this);
this.videoplayer.node.on('completed', this.onCompleted, this);
const playerWidget = this.videoplayer.getComponent(cc.Widget);
if((canvas.width / canvas.height) >=1) {
// 横屏
......@@ -706,6 +694,21 @@ cc.Class({
playerWidget.enabled = true;
this.videoplayer.width = canvas.width;
}
},
initView() {
this.initBg();
this.videoplayer.node.on('ready-to-play', this.onReadyToPlay, this);
this.videoplayer.node.on('meta-loaded', this.onMetaLoaded, this);
this.videoplayer.node.on('clicked', this.onClicked, this);
this.videoplayer.node.on('playing', this.onPlaying, this);
// this.videoplayer.node.on('paused', this.onPaused, this);
// this.videoplayer.node.on('stopped', this.onStoped, this);
this.videoplayer.node.on('completed', this.onCompleted, this);
this.alignVideoPlayer();
// this.initPic();
// this.initBtn();
// this.initIcon();
......
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