王士厅

fix: 在热点频道下,进入横屏视频详情,点击分享按钮后,再取消分享,视频不能续播

@@ -35,10 +35,12 @@ export struct PlayerFullScreenView { @@ -35,10 +35,12 @@ export struct PlayerFullScreenView {
35 35
36 share() { 36 share() {
37 this.playerController?.switchPlayOrPause() 37 this.playerController?.switchPlayOrPause()
38 - WDShare.shareContent(this.contentDetailData)  
39 - // WDShare.shareContent(this.contentDetailData).then(() => {  
40 - // this.playerController?.switchPlayOrPause()  
41 - // }) 38 + WDShare.shareContent(this.contentDetailData).then((res) => {
  39 + // console.log(TAG, "分享弹框关闭", res);
  40 + if(res == 'dismiss') {
  41 + this.playerController?.switchPlayOrPause()
  42 + }
  43 + })
42 } 44 }
43 45
44 updateProgress() { 46 updateProgress() {
@@ -9,10 +9,9 @@ import { AppInnerLinkGenerator } from 'wdRouter'; @@ -9,10 +9,9 @@ import { AppInnerLinkGenerator } from 'wdRouter';
9 9
10 export class WDShare { 10 export class WDShare {
11 11
12 - static shareContent(content: ContentDetailDTO, pageName: string ="", pageId: string = "") {  
13 -  
14 - //TODO: 处理分享弹框交互和 海报逻辑  
15 - 12 + static shareContent(content: ContentDetailDTO, pageName: string = "", pageId: string = ""): Promise<string> {
  13 + return new Promise((resolve, reject) => {
  14 + // 处理分享弹框交互和海报逻辑
16 WDShareBase.getInstance().share({ 15 WDShareBase.getInstance().share({
17 to: ShareType.System, 16 to: ShareType.System,
18 scene: ShareScene.System, 17 scene: ShareScene.System,
@@ -21,10 +20,17 @@ export class WDShare { @@ -21,10 +20,17 @@ export class WDShare {
21 title: content.shareInfo.shareTitle, 20 title: content.shareInfo.shareTitle,
22 desc: content.shareInfo.shareSummary, 21 desc: content.shareInfo.shareSummary,
23 link: content.shareInfo.shareUrl, 22 link: content.shareInfo.shareUrl,
24 - deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content),  
25 - posterImg:$r("app.media.test_share_poster"), 23 + deeplink: AppInnerLinkGenerator.generateDeepLinkWithConent(content),
  24 + posterImg: $r("app.media.test_share_poster"),
26 } 25 }
27 - }) 26 + })?.then((res) => {
  27 + // console.log("分享成功", res);
  28 + resolve(res);
  29 + }).catch((() => {
  30 + // console.error("分享失败");
  31 + reject("error");
  32 + }))
  33 + });
28 } 34 }
29 35
30 static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") { 36 static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") {