|
27 | 27 | import cn.com.venvy.common.bean.WidgetInfo; |
28 | 28 | import cn.com.venvy.common.exception.LoginException; |
29 | 29 | import cn.com.venvy.common.interf.ICallJsFunction; |
| 30 | +import cn.com.venvy.common.interf.IMediaControlListener; |
30 | 31 | import cn.com.venvy.common.interf.IPlatformLoginInterface; |
31 | 32 | import cn.com.venvy.common.observer.ObservableManager; |
32 | 33 | import cn.com.venvy.common.observer.VenvyObservable; |
@@ -115,6 +116,7 @@ public void commonData(String jsParams) { |
115 | 116 | xyObj.put("y", mVenvyWebView.getWebViewY()); |
116 | 117 | obj.put("origin", xyObj); |
117 | 118 | obj.put("secret", mPlatform.getPlatformInfo().getAppSecret()); |
| 119 | + obj.put("videoInfo", getVideoInfo()); |
118 | 120 | } catch (Exception e) { |
119 | 121 |
|
120 | 122 | } |
@@ -662,4 +664,23 @@ private String getIdentity() { |
662 | 664 | } |
663 | 665 | return ""; |
664 | 666 | } |
| 667 | + |
| 668 | + private JSONObject getVideoInfo() { |
| 669 | + JSONObject jsonObject = new JSONObject(); |
| 670 | + |
| 671 | + try { |
| 672 | + if (mPlatform != null) { |
| 673 | + jsonObject.put("videoID", mPlatform.getPlatformInfo().getVideoId()); |
| 674 | + IMediaControlListener mediaControlListener = mPlatform.getMediaControlListener(); |
| 675 | + if (mediaControlListener != null) { |
| 676 | + jsonObject.put("title", TextUtils.isEmpty(mediaControlListener.getVideoTitle()) ? "" : mediaControlListener.getVideoTitle()); |
| 677 | + jsonObject.put("episode", TextUtils.isEmpty(mediaControlListener.getVideoEpisode()) ? "" : mediaControlListener.getVideoEpisode()); |
| 678 | + } |
| 679 | + } |
| 680 | + } catch (JSONException e) { |
| 681 | + e.printStackTrace(); |
| 682 | + } |
| 683 | + |
| 684 | + return jsonObject; |
| 685 | + } |
665 | 686 | } |
0 commit comments