[engine] [cocos2d-x] [jsb-adapter] 适配引擎 v2.4.13 版本

This commit is contained in:
SmallMain
2024-10-16 16:23:25 +08:00
parent 7f956acda7
commit 887d4a96c9
61 changed files with 1313 additions and 981 deletions

View File

@@ -354,8 +354,8 @@ const cacheManager = require('./jsb-cache-manager');
}
if (this._nativeSkeleton) {
this._nativeSkeleton.stopSchedule();
this._nativeSkeleton._comp = null;
this._nativeSkeleton.destroy();
this._nativeSkeleton = null;
}
@@ -763,8 +763,8 @@ const cacheManager = require('./jsb-cache-manager');
this.animation = this.defaultAnimation;
} else {
if (this._nativeSkeleton) {
this._nativeSkeleton.stopSchedule();
this._nativeSkeleton._comp = null;
this._nativeSkeleton.destroy();
this._nativeSkeleton = null;
}
}
@@ -774,8 +774,8 @@ const cacheManager = require('./jsb-cache-manager');
skeleton.onDestroy = function(){
_onDestroy.call(this);
if (this._nativeSkeleton) {
this._nativeSkeleton.stopSchedule();
this._nativeSkeleton._comp = null;
this._nativeSkeleton.destroy();
this._nativeSkeleton = null;
}
this._stateData = null;

View File

@@ -35,7 +35,7 @@
var _topLeft = new vec3();
var _bottomRight = new vec3();
let kWebViewTag = 0;
let kVideoTag = 0;
let videoPlayers = [];
const VideoEvent = {
PLAYING: 0,
@@ -143,6 +143,16 @@
video.setVisible(false)
let cbs = this.__eventListeners;
video.removeEventListener("loadedmetadata", cbs.loadedmetadata);
video.removeEventListener("ended", cbs.ended);
video.removeEventListener("play", cbs.play);
video.removeEventListener("pause", cbs.pause);
video.removeEventListener("click", cbs.click);
video.removeEventListener("canplay", cbs.onCanPlay);
video.removeEventListener("canplaythrough", cbs.onCanPlay);
video.removeEventListener("suspend", cbs.onCanPlay);
cbs.loadedmetadata = null;
cbs.ended = null;
cbs.play = null;
@@ -218,7 +228,7 @@
let video = this._video;
if (!video || !this._visible) return;
// TODO(qgh) : In the openharmony platform, there is no stop event when the video stops, instead a pause event is sent.
// We can't ignore the pause event here.
// We can't ignore the pause event here.
// this._ignorePause = true;
video.seekTo(0);
video.stop();
@@ -480,7 +490,7 @@
this._events = {};
this._currentTime = 0;
this._duration = 0;
this._videoIndex = kWebViewTag++;
this._videoIndex = kVideoTag++;
this._matViewProj_temp = new mat4();
window.oh.postMessage("createVideo", this._videoIndex);
videoPlayers.push(this);