Jelajahi Sumber

fix(player): enforce playback coordinator singleton

onecold 4 bulan lalu
induk
melakukan
051fd10b8f

+ 1 - 0
entry/src/main/ets/controller/PlaybackCoordinator.ets

@@ -13,6 +13,7 @@ export class PlaybackCoordinator {
   private static instance?: PlaybackCoordinator
   private runtime?: PlaybackRuntime
   private stateBridge: PlaybackStateBridge = PlaybackStateBridge.getInstance()
+  private constructor() {}
 
   public static getInstance(): PlaybackCoordinator {
     if (!PlaybackCoordinator.instance) {

+ 2 - 0
entry/src/ohosTest/ets/test/List.test.ets

@@ -14,9 +14,11 @@
  */
 
 import abilityTest from './Ability.test'
+import playbackCoordinatorTest from './PlaybackCoordinator.test'
 import playbackStateBridgeTest from './PlaybackStateBridge.test'
 
 export default function testsuite() {
   abilityTest()
+  playbackCoordinatorTest()
   playbackStateBridgeTest()
 }