xugenyuan

ref |> 播控中心处理contentId为空情况

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -69,14 +69,14 @@ export class BackgroundAudioController { @@ -69,14 +69,14 @@ export class BackgroundAudioController {
69 69
70 //设置播放元数据 70 //设置播放元数据
71 async setSessionMetaData(assetId: string, title: string, mediaImage: Resource, artist: string) { 71 async setSessionMetaData(assetId: string, title: string, mediaImage: Resource, artist: string) {
72 - this.lastItemAssetId = assetId  
73 - this.lastItemTitle = title 72 + this.lastItemAssetId = assetId.length > 0 ? assetId : ""
  73 + this.lastItemTitle = title || ""
74 this.lastItemMediaImage = mediaImage 74 this.lastItemMediaImage = mediaImage
75 - this.lastItemArtist = artist 75 + this.lastItemArtist = artist || ""
76 } 76 }
77 77
78 async setSessionMetaDataWithDuration(assetId: string, title: string, mediaImage: Resource, artist: string, duration: number) { 78 async setSessionMetaDataWithDuration(assetId: string, title: string, mediaImage: Resource, artist: string, duration: number) {
79 - Logger.debug(TAG, `SetAVMetadata assetId: ${assetId}}, title: ${title}, mediaImage: ${mediaImage}, artist: ${artist}, duration: ${duration}`); 79 + Logger.debug(TAG, `SetAVMetadata assetId: ${assetId}, title: ${title}, mediaImage: ${mediaImage}, artist: ${artist}, duration: ${duration}`);
80 80
81 if (!this.gotContextFunc) { return } 81 if (!this.gotContextFunc) { return }
82 let pixelMapImage:image.PixelMap | null = null 82 let pixelMapImage:image.PixelMap | null = null
@@ -168,7 +168,7 @@ export class BackgroundAudioController { @@ -168,7 +168,7 @@ export class BackgroundAudioController {
168 // Logger.debug(TAG, `set progress: ` + progressDuration + " duration: " + totalDuration); 168 // Logger.debug(TAG, `set progress: ` + progressDuration + " duration: " + totalDuration);
169 this.lastProgress = newProgress 169 this.lastProgress = newProgress
170 170
171 - if (this.lastItemAssetId) { 171 + if (this.lastItemAssetId != undefined) {
172 this.lastItemTotalDuration = totalDuration 172 this.lastItemTotalDuration = totalDuration
173 await this.setSessionMetaDataWithDuration( 173 await this.setSessionMetaDataWithDuration(
174 this.lastItemAssetId ?? "", 174 this.lastItemAssetId ?? "",