Commit 736e9a8d 736e9a8d8593bd9a81767665275e93e223af4807 by 金学艇

修复全屏播放器获取不到播放链接问题

1 parent 1a20c129
......@@ -40,10 +40,13 @@ cc.Class({
if (aSceneParameter.length) {
this._oSceneContext.name = aSceneParameter[aSceneParameter.length - 1].name;
this._oSceneContext.url = aSceneParameter[aSceneParameter.length - 1].url;
this._oSceneContext.fileCode = aSceneParameter[aSceneParameter.length - 1].fileCode;
} else if (aSceneParameter) {
this._oSceneContext.name = aSceneParameter.name;
this._oSceneContext.url = aSceneParameter.url;
this._oSceneContext.fileCode = aSceneParameter[aSceneParameter.length - 1].fileCode;
}
// this._cLog.screenI("VideoPalyer.js->onLoad| " + this._oSceneContext.url + " || " + this._oSceneContext.fileCode);
cc.find("SongNames/CurrentName", this.node).getComponent(cc.Label).string = this._oSceneContext.name || "";
//参数
this._oDefaultBackASceneParameter = {};
......@@ -524,12 +527,13 @@ cc.Class({
onCheckQueryNewTV: function (options) {
try {
cc.log("onCheckQueryNewTV start...");
this._cLog.screenI("SubIndex拿到播放播放地址" + options);
this._cLog.screenI("SubIndex拿到播放播放地址" + this._oSceneContext.url + " || " + this._oSceneContext.fileCode);
// jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "checkQueryNewTV", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", options, "onGetPlayURL", "checkQueryFail");
this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试
let options = {};
options.playurl = this._oSceneContext.url;
options.fileCode = this._oSceneContext.fileCode;
this._ComOperation.setURL(options); //测试播放地址
} catch (error) {
if (cc.sys.isNative) {
......
......@@ -29,6 +29,7 @@ cc.Class({
onLoad: function () {
this._super();
this._oInit = {};
this.options = {};
this._bCollected = false;
this._oSceneContext.focusPath = "ButtonFullScreen";
this._oSceneContext.currentPage = 1;
......@@ -80,7 +81,7 @@ cc.Class({
this._oEpisode = oJSONResult;
if (oJSONResult.businessCode == 'success') {
for (let i = 0; i < 20; i++) {
if (i >= oJSONResult.resultSet.length) {//数据较少时
if (i >= oJSONResult.count) {//数据较少时
continue;
}
let nodeEpisodeCell = cc.find("EpisodeListCell" + i, this._nodeEpisodeList);
......@@ -198,7 +199,6 @@ cc.Class({
if (cc.sys.isNative) {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "getPlayUrl", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", this._oInit.supercid, this._oInit.cid, "getPlayURLAndPlay");
}
} else {
cc.log("Business Error:Get checkPfbReadyAndInitPage..." + oJSONResult.description);
}
......@@ -232,14 +232,16 @@ cc.Class({
getPlayURLAndPlay: function (playUrl) {
try {
cc.log("videoDetail.js -> getPlayURLAndPlay | " + playUrl);
// this._cLog.screenI("videoDetail.js -> getPlayURLAndPlay | " + playUrl);
this._ComOperation.initPlayer(64, 56, 564, 317, true, true); //这里采用左右边距对应android坐标 fix jerry
// this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试
let options = {};
// options.playurl = this._oInit.url;
options.playurl = playUrl;
options.fileCode = this._oInit.fileCode;
this._ComOperation.setURL(options); //测试播放地址
this.options.playurl = playUrl; //这个值可能会在OperateVideoPlayer中删除掉,重新造个值
this.options.url = playUrl;
this.options.fileCode = this._oInit.fileCode;
this._ComOperation.setURL(this.options); //测试播放地址
// this._cLog.screenI("VideoDetail.js->getPlayURLAndPlay | " + this.options.playurl + " || " + this.options.fileCode);
} catch (error) {
if (cc.sys.isNative) {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "getPlayURLAndPlay Error in SongLibraryPlayer==>" + error);
......@@ -263,7 +265,7 @@ cc.Class({
var nodeButtonCollect = cc.find("ButtonCollect", this.node);
let fiButtonFullScreen = nodeButtonFullScreen.addComponent(FocusInfo); //
fiButtonFullScreen.init('', true, null, null, 1.0);
fiButtonFullScreen.init('{"click": [{"action": "PlaySongInFullScreen"}]}', true, null, null, 1.0);
this._aFocusTargets[0]['node_button_full_screen'] = nodeButtonFullScreen;
let fiButtonCollect = nodeButtonCollect.addComponent(FocusInfo); //
......@@ -389,7 +391,7 @@ cc.Class({
// });
} else if (0 == this._fiCurrentFocus.node.name.indexOf('LabelDesc')) {
cc.find("FullDesc", this.node).active = true;
} else if (0 == this._fiCurrentFocus.node.name.indexOf('ButtonOpen') || 0 == this._fiCurrentFocus.node.name.indexOf('Pic')) {
} else if (0 == this._fiCurrentFocus.node.name.indexOf('ButtonFullScreen') || 0 == this._fiCurrentFocus.node.name.indexOf('Pic')) {
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
return;
} else {
......@@ -426,25 +428,6 @@ cc.Class({
cc.log("检查存储:" + cc.sys.localStorage.getItem("collectList"));
},
doCurrentFocusTVLinkAction: function (strAction) {
let strTVLink = this._fiCurrentFocus.getTVLink();
cc.log("tvlink===============" + strTVLink);
try {
let oTVLink = JSON.parse(strTVLink);
let aOperationList = oTVLink.click;
for (let i = 0; i < aOperationList.length; i++) {
switch (aOperationList[i].action) {
case "changeLayout":
default:
this.doTVLinkAction(aOperationList[i]);
break;
}
}
} catch (error) {
cc.log("runTVLinkAction Exception..." + error);
}
},
onBeforeFocusChange: function (event) {
let fiFrom = event.detail.from;
......@@ -545,13 +528,14 @@ cc.Class({
let compApplication = cc.find('application').getComponent(Application);
let aSceneContext = compApplication.getSceneContext();
let aSceneParameter = compApplication.getSceneParameter();
// this._cLog.screenI("VideoDetail.js->doCurrentFocusTVLinkAction | " + this.options.playurl + " || " + this.options.fileCode);
for (let i = 0; i < jaOperationList.length; i++) {
let strMediaId;
switch (jaOperationList[i].action) {
case "PlaySongInFullScreen":
aSceneParameter.push({
"name": this._oInit.name,
"url": this._oInit.url,
"url": this.options.url,
"fileCode": this.options.fileCode,
"backSceneName": cc.director.getScene().name,
});
// this._oSceneContext.focusPath = Common.getNodePath(this._fiCurrentFocus.node);
......
......@@ -4,8 +4,8 @@
"resultSet": [
{
"name": "魔法啥拉",
"episode_number": 15,
"current_episode_number": 15,
"episode_number": 1,
"current_episode_number": 1,
"fileCode": "file_997b7cb4-573c-4916-b575-4c0bc9476f9b_TS4M1080p",
"supercid": "42dab385e29e4f0f99c3513939815a2c",
"cid": "898abfacb6a34c19b36708ebb43ad044",
......
{
"businessCode": "success",
"count": 64,
"count": 1,
"count2": 64,
"currentTime": 1584672100682,
"description": "",
"resultSet": [
......