修复全屏播放器获取不到播放链接问题
Showing
4 changed files
with
23 additions
and
34 deletions
| ... | @@ -40,10 +40,13 @@ cc.Class({ | ... | @@ -40,10 +40,13 @@ cc.Class({ |
| 40 | if (aSceneParameter.length) { | 40 | if (aSceneParameter.length) { |
| 41 | this._oSceneContext.name = aSceneParameter[aSceneParameter.length - 1].name; | 41 | this._oSceneContext.name = aSceneParameter[aSceneParameter.length - 1].name; |
| 42 | this._oSceneContext.url = aSceneParameter[aSceneParameter.length - 1].url; | 42 | this._oSceneContext.url = aSceneParameter[aSceneParameter.length - 1].url; |
| 43 | this._oSceneContext.fileCode = aSceneParameter[aSceneParameter.length - 1].fileCode; | ||
| 43 | } else if (aSceneParameter) { | 44 | } else if (aSceneParameter) { |
| 44 | this._oSceneContext.name = aSceneParameter.name; | 45 | this._oSceneContext.name = aSceneParameter.name; |
| 45 | this._oSceneContext.url = aSceneParameter.url; | 46 | this._oSceneContext.url = aSceneParameter.url; |
| 47 | this._oSceneContext.fileCode = aSceneParameter[aSceneParameter.length - 1].fileCode; | ||
| 46 | } | 48 | } |
| 49 | // this._cLog.screenI("VideoPalyer.js->onLoad| " + this._oSceneContext.url + " || " + this._oSceneContext.fileCode); | ||
| 47 | cc.find("SongNames/CurrentName", this.node).getComponent(cc.Label).string = this._oSceneContext.name || ""; | 50 | cc.find("SongNames/CurrentName", this.node).getComponent(cc.Label).string = this._oSceneContext.name || ""; |
| 48 | //参数 | 51 | //参数 |
| 49 | this._oDefaultBackASceneParameter = {}; | 52 | this._oDefaultBackASceneParameter = {}; |
| ... | @@ -524,12 +527,13 @@ cc.Class({ | ... | @@ -524,12 +527,13 @@ cc.Class({ |
| 524 | onCheckQueryNewTV: function (options) { | 527 | onCheckQueryNewTV: function (options) { |
| 525 | try { | 528 | try { |
| 526 | cc.log("onCheckQueryNewTV start..."); | 529 | cc.log("onCheckQueryNewTV start..."); |
| 527 | this._cLog.screenI("SubIndex拿到播放播放地址" + options); | 530 | this._cLog.screenI("SubIndex拿到播放播放地址" + this._oSceneContext.url + " || " + this._oSceneContext.fileCode); |
| 528 | // jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "checkQueryNewTV", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", options, "onGetPlayURL", "checkQueryFail"); | 531 | // jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "checkQueryNewTV", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", options, "onGetPlayURL", "checkQueryFail"); |
| 529 | 532 | ||
| 530 | this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试 | 533 | this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试 |
| 531 | let options = {}; | 534 | let options = {}; |
| 532 | options.playurl = this._oSceneContext.url; | 535 | options.playurl = this._oSceneContext.url; |
| 536 | options.fileCode = this._oSceneContext.fileCode; | ||
| 533 | this._ComOperation.setURL(options); //测试播放地址 | 537 | this._ComOperation.setURL(options); //测试播放地址 |
| 534 | } catch (error) { | 538 | } catch (error) { |
| 535 | if (cc.sys.isNative) { | 539 | if (cc.sys.isNative) { | ... | ... |
| ... | @@ -29,6 +29,7 @@ cc.Class({ | ... | @@ -29,6 +29,7 @@ cc.Class({ |
| 29 | onLoad: function () { | 29 | onLoad: function () { |
| 30 | this._super(); | 30 | this._super(); |
| 31 | this._oInit = {}; | 31 | this._oInit = {}; |
| 32 | this.options = {}; | ||
| 32 | this._bCollected = false; | 33 | this._bCollected = false; |
| 33 | this._oSceneContext.focusPath = "ButtonFullScreen"; | 34 | this._oSceneContext.focusPath = "ButtonFullScreen"; |
| 34 | this._oSceneContext.currentPage = 1; | 35 | this._oSceneContext.currentPage = 1; |
| ... | @@ -80,7 +81,7 @@ cc.Class({ | ... | @@ -80,7 +81,7 @@ cc.Class({ |
| 80 | this._oEpisode = oJSONResult; | 81 | this._oEpisode = oJSONResult; |
| 81 | if (oJSONResult.businessCode == 'success') { | 82 | if (oJSONResult.businessCode == 'success') { |
| 82 | for (let i = 0; i < 20; i++) { | 83 | for (let i = 0; i < 20; i++) { |
| 83 | if (i >= oJSONResult.resultSet.length) {//数据较少时 | 84 | if (i >= oJSONResult.count) {//数据较少时 |
| 84 | continue; | 85 | continue; |
| 85 | } | 86 | } |
| 86 | let nodeEpisodeCell = cc.find("EpisodeListCell" + i, this._nodeEpisodeList); | 87 | let nodeEpisodeCell = cc.find("EpisodeListCell" + i, this._nodeEpisodeList); |
| ... | @@ -198,7 +199,6 @@ cc.Class({ | ... | @@ -198,7 +199,6 @@ cc.Class({ |
| 198 | if (cc.sys.isNative) { | 199 | if (cc.sys.isNative) { |
| 199 | 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"); | 200 | 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"); |
| 200 | } | 201 | } |
| 201 | |||
| 202 | } else { | 202 | } else { |
| 203 | cc.log("Business Error:Get checkPfbReadyAndInitPage..." + oJSONResult.description); | 203 | cc.log("Business Error:Get checkPfbReadyAndInitPage..." + oJSONResult.description); |
| 204 | } | 204 | } |
| ... | @@ -232,14 +232,16 @@ cc.Class({ | ... | @@ -232,14 +232,16 @@ cc.Class({ |
| 232 | 232 | ||
| 233 | getPlayURLAndPlay: function (playUrl) { | 233 | getPlayURLAndPlay: function (playUrl) { |
| 234 | try { | 234 | try { |
| 235 | cc.log("videoDetail.js -> getPlayURLAndPlay | " + playUrl); | 235 | // this._cLog.screenI("videoDetail.js -> getPlayURLAndPlay | " + playUrl); |
| 236 | this._ComOperation.initPlayer(64, 56, 564, 317, true, true); //这里采用左右边距对应android坐标 fix jerry | 236 | this._ComOperation.initPlayer(64, 56, 564, 317, true, true); //这里采用左右边距对应android坐标 fix jerry |
| 237 | // this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试 | 237 | // this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试 |
| 238 | let options = {}; | 238 | |
| 239 | // options.playurl = this._oInit.url; | 239 | // options.playurl = this._oInit.url; |
| 240 | options.playurl = playUrl; | 240 | this.options.playurl = playUrl; //这个值可能会在OperateVideoPlayer中删除掉,重新造个值 |
| 241 | options.fileCode = this._oInit.fileCode; | 241 | this.options.url = playUrl; |
| 242 | this._ComOperation.setURL(options); //测试播放地址 | 242 | this.options.fileCode = this._oInit.fileCode; |
| 243 | this._ComOperation.setURL(this.options); //测试播放地址 | ||
| 244 | // this._cLog.screenI("VideoDetail.js->getPlayURLAndPlay | " + this.options.playurl + " || " + this.options.fileCode); | ||
| 243 | } catch (error) { | 245 | } catch (error) { |
| 244 | if (cc.sys.isNative) { | 246 | if (cc.sys.isNative) { |
| 245 | jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "getPlayURLAndPlay Error in SongLibraryPlayer==>" + error); | 247 | jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "logInSceneI", "(Ljava/lang/String;)V", "getPlayURLAndPlay Error in SongLibraryPlayer==>" + error); |
| ... | @@ -263,7 +265,7 @@ cc.Class({ | ... | @@ -263,7 +265,7 @@ cc.Class({ |
| 263 | var nodeButtonCollect = cc.find("ButtonCollect", this.node); | 265 | var nodeButtonCollect = cc.find("ButtonCollect", this.node); |
| 264 | 266 | ||
| 265 | let fiButtonFullScreen = nodeButtonFullScreen.addComponent(FocusInfo); // | 267 | let fiButtonFullScreen = nodeButtonFullScreen.addComponent(FocusInfo); // |
| 266 | fiButtonFullScreen.init('', true, null, null, 1.0); | 268 | fiButtonFullScreen.init('{"click": [{"action": "PlaySongInFullScreen"}]}', true, null, null, 1.0); |
| 267 | this._aFocusTargets[0]['node_button_full_screen'] = nodeButtonFullScreen; | 269 | this._aFocusTargets[0]['node_button_full_screen'] = nodeButtonFullScreen; |
| 268 | 270 | ||
| 269 | let fiButtonCollect = nodeButtonCollect.addComponent(FocusInfo); // | 271 | let fiButtonCollect = nodeButtonCollect.addComponent(FocusInfo); // |
| ... | @@ -389,7 +391,7 @@ cc.Class({ | ... | @@ -389,7 +391,7 @@ cc.Class({ |
| 389 | // }); | 391 | // }); |
| 390 | } else if (0 == this._fiCurrentFocus.node.name.indexOf('LabelDesc')) { | 392 | } else if (0 == this._fiCurrentFocus.node.name.indexOf('LabelDesc')) { |
| 391 | cc.find("FullDesc", this.node).active = true; | 393 | cc.find("FullDesc", this.node).active = true; |
| 392 | } else if (0 == this._fiCurrentFocus.node.name.indexOf('ButtonOpen') || 0 == this._fiCurrentFocus.node.name.indexOf('Pic')) { | 394 | } else if (0 == this._fiCurrentFocus.node.name.indexOf('ButtonFullScreen') || 0 == this._fiCurrentFocus.node.name.indexOf('Pic')) { |
| 393 | this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK); | 395 | this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK); |
| 394 | return; | 396 | return; |
| 395 | } else { | 397 | } else { |
| ... | @@ -426,25 +428,6 @@ cc.Class({ | ... | @@ -426,25 +428,6 @@ cc.Class({ |
| 426 | cc.log("检查存储:" + cc.sys.localStorage.getItem("collectList")); | 428 | cc.log("检查存储:" + cc.sys.localStorage.getItem("collectList")); |
| 427 | }, | 429 | }, |
| 428 | 430 | ||
| 429 | doCurrentFocusTVLinkAction: function (strAction) { | ||
| 430 | let strTVLink = this._fiCurrentFocus.getTVLink(); | ||
| 431 | cc.log("tvlink===============" + strTVLink); | ||
| 432 | try { | ||
| 433 | let oTVLink = JSON.parse(strTVLink); | ||
| 434 | let aOperationList = oTVLink.click; | ||
| 435 | for (let i = 0; i < aOperationList.length; i++) { | ||
| 436 | switch (aOperationList[i].action) { | ||
| 437 | case "changeLayout": | ||
| 438 | default: | ||
| 439 | this.doTVLinkAction(aOperationList[i]); | ||
| 440 | break; | ||
| 441 | } | ||
| 442 | } | ||
| 443 | } catch (error) { | ||
| 444 | cc.log("runTVLinkAction Exception..." + error); | ||
| 445 | } | ||
| 446 | }, | ||
| 447 | |||
| 448 | onBeforeFocusChange: function (event) { | 431 | onBeforeFocusChange: function (event) { |
| 449 | 432 | ||
| 450 | let fiFrom = event.detail.from; | 433 | let fiFrom = event.detail.from; |
| ... | @@ -545,13 +528,14 @@ cc.Class({ | ... | @@ -545,13 +528,14 @@ cc.Class({ |
| 545 | let compApplication = cc.find('application').getComponent(Application); | 528 | let compApplication = cc.find('application').getComponent(Application); |
| 546 | let aSceneContext = compApplication.getSceneContext(); | 529 | let aSceneContext = compApplication.getSceneContext(); |
| 547 | let aSceneParameter = compApplication.getSceneParameter(); | 530 | let aSceneParameter = compApplication.getSceneParameter(); |
| 531 | // this._cLog.screenI("VideoDetail.js->doCurrentFocusTVLinkAction | " + this.options.playurl + " || " + this.options.fileCode); | ||
| 548 | for (let i = 0; i < jaOperationList.length; i++) { | 532 | for (let i = 0; i < jaOperationList.length; i++) { |
| 549 | let strMediaId; | ||
| 550 | switch (jaOperationList[i].action) { | 533 | switch (jaOperationList[i].action) { |
| 551 | case "PlaySongInFullScreen": | 534 | case "PlaySongInFullScreen": |
| 552 | aSceneParameter.push({ | 535 | aSceneParameter.push({ |
| 553 | "name": this._oInit.name, | 536 | "name": this._oInit.name, |
| 554 | "url": this._oInit.url, | 537 | "url": this.options.url, |
| 538 | "fileCode": this.options.fileCode, | ||
| 555 | "backSceneName": cc.director.getScene().name, | 539 | "backSceneName": cc.director.getScene().name, |
| 556 | }); | 540 | }); |
| 557 | // this._oSceneContext.focusPath = Common.getNodePath(this._fiCurrentFocus.node); | 541 | // this._oSceneContext.focusPath = Common.getNodePath(this._fiCurrentFocus.node); | ... | ... |
| ... | @@ -4,8 +4,8 @@ | ... | @@ -4,8 +4,8 @@ |
| 4 | "resultSet": [ | 4 | "resultSet": [ |
| 5 | { | 5 | { |
| 6 | "name": "魔法啥拉", | 6 | "name": "魔法啥拉", |
| 7 | "episode_number": 15, | 7 | "episode_number": 1, |
| 8 | "current_episode_number": 15, | 8 | "current_episode_number": 1, |
| 9 | "fileCode": "file_997b7cb4-573c-4916-b575-4c0bc9476f9b_TS4M1080p", | 9 | "fileCode": "file_997b7cb4-573c-4916-b575-4c0bc9476f9b_TS4M1080p", |
| 10 | "supercid": "42dab385e29e4f0f99c3513939815a2c", | 10 | "supercid": "42dab385e29e4f0f99c3513939815a2c", |
| 11 | "cid": "898abfacb6a34c19b36708ebb43ad044", | 11 | "cid": "898abfacb6a34c19b36708ebb43ad044", | ... | ... |
-
Please register or sign in to post a comment