unika-components 1.1.19 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -714,26 +714,25 @@ const useMusicManager = () => {
714
714
  }
715
715
  catch (err) {
716
716
  // 如果失败,尝试静音播放然后解除静音
717
- try {
718
- audio.muted = true;
719
- await audio.play();
720
- // 播放成功后再解除静音
721
- setTimeout(() => {
722
- audio.muted = false;
723
- }, 1000);
724
- musicState.value.audioElement = audio;
725
- musicState.value.isPlaying = true;
726
- musicState.value.currentMusicId = musicData.music_id || musicData.id || null;
727
- musicState.value.isGlobalMusic = musicData.isGlobal || false;
728
- musicState.value.canPlay = true;
729
- }
730
- catch (mutedErr) {
731
- console.log('Muted autoplay also failed:', mutedErr);
732
- // 保留audio实例等待交互
733
- musicState.value.audioElement = audio;
734
- musicState.value.currentMusicId = musicData.music_id || musicData.id || null;
735
- musicState.value.isGlobalMusic = musicData.isGlobal || false;
736
- }
717
+ // try {
718
+ // audio.muted = true
719
+ // await audio.play()
720
+ // // 播放成功后再解除静音
721
+ // setTimeout(() => {
722
+ // audio.muted = false
723
+ // }, 1000)
724
+ // musicState.value.audioElement = audio
725
+ // musicState.value.isPlaying = true
726
+ // musicState.value.currentMusicId = musicData.music_id || musicData.id || null
727
+ // musicState.value.isGlobalMusic = musicData.isGlobal || false
728
+ // musicState.value.canPlay = true
729
+ // } catch (mutedErr) {
730
+ // console.log('Muted autoplay also failed:', mutedErr)
731
+ // // 保留audio实例等待交互
732
+ // musicState.value.audioElement = audio
733
+ // musicState.value.currentMusicId = musicData.music_id || musicData.id || null
734
+ // musicState.value.isGlobalMusic = musicData.isGlobal || false
735
+ // }
737
736
  }
738
737
  musicState.value.attemptedAutoplay = true;
739
738
  };
@@ -30004,7 +30003,9 @@ var script$2 = defineComponent({
30004
30003
  const handleFirstInteraction = () => {
30005
30004
  const currentState = getCurrentMusicState();
30006
30005
  if (!currentState.isPlaying && global.value.music.url) {
30007
- playOnInteraction();
30006
+ playOnInteraction().then(result => {
30007
+ musicStatus.value = result;
30008
+ });
30008
30009
  }
30009
30010
  else {
30010
30011
  musicStatus.value = true;
@@ -30317,6 +30318,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
30317
30318
  }
30318
30319
 
30319
30320
  script$2.render = render$2;
30321
+ script$2.__scopeId = "data-v-3bcd7a62";
30320
30322
  script$2.__file = "src/components/WorkRenderH5/WorkRenderH5.vue";
30321
30323
 
30322
30324
  script$2.install = (app) => {
@@ -30463,7 +30465,9 @@ var script$1 = defineComponent({
30463
30465
  const handleFirstInteraction = () => {
30464
30466
  const currentState = getCurrentMusicState();
30465
30467
  if (!currentState.isPlaying && global.value.music.url) {
30466
- playOnInteraction();
30468
+ playOnInteraction().then(result => {
30469
+ musicStatus.value = result;
30470
+ });
30467
30471
  }
30468
30472
  else {
30469
30473
  musicStatus.value = true;
@@ -30807,6 +30811,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
30807
30811
  }
30808
30812
 
30809
30813
  script$1.render = render$1;
30814
+ script$1.__scopeId = "data-v-f435efa2";
30810
30815
  script$1.__file = "src/components/WorkRenderLong/WorkRenderLong.vue";
30811
30816
 
30812
30817
  script$1.install = (app) => {
@@ -721,26 +721,25 @@
721
721
  }
722
722
  catch (err) {
723
723
  // 如果失败,尝试静音播放然后解除静音
724
- try {
725
- audio.muted = true;
726
- await audio.play();
727
- // 播放成功后再解除静音
728
- setTimeout(() => {
729
- audio.muted = false;
730
- }, 1000);
731
- musicState.value.audioElement = audio;
732
- musicState.value.isPlaying = true;
733
- musicState.value.currentMusicId = musicData.music_id || musicData.id || null;
734
- musicState.value.isGlobalMusic = musicData.isGlobal || false;
735
- musicState.value.canPlay = true;
736
- }
737
- catch (mutedErr) {
738
- console.log('Muted autoplay also failed:', mutedErr);
739
- // 保留audio实例等待交互
740
- musicState.value.audioElement = audio;
741
- musicState.value.currentMusicId = musicData.music_id || musicData.id || null;
742
- musicState.value.isGlobalMusic = musicData.isGlobal || false;
743
- }
724
+ // try {
725
+ // audio.muted = true
726
+ // await audio.play()
727
+ // // 播放成功后再解除静音
728
+ // setTimeout(() => {
729
+ // audio.muted = false
730
+ // }, 1000)
731
+ // musicState.value.audioElement = audio
732
+ // musicState.value.isPlaying = true
733
+ // musicState.value.currentMusicId = musicData.music_id || musicData.id || null
734
+ // musicState.value.isGlobalMusic = musicData.isGlobal || false
735
+ // musicState.value.canPlay = true
736
+ // } catch (mutedErr) {
737
+ // console.log('Muted autoplay also failed:', mutedErr)
738
+ // // 保留audio实例等待交互
739
+ // musicState.value.audioElement = audio
740
+ // musicState.value.currentMusicId = musicData.music_id || musicData.id || null
741
+ // musicState.value.isGlobalMusic = musicData.isGlobal || false
742
+ // }
744
743
  }
745
744
  musicState.value.attemptedAutoplay = true;
746
745
  };
@@ -30011,7 +30010,9 @@
30011
30010
  const handleFirstInteraction = () => {
30012
30011
  const currentState = getCurrentMusicState();
30013
30012
  if (!currentState.isPlaying && global.value.music.url) {
30014
- playOnInteraction();
30013
+ playOnInteraction().then(result => {
30014
+ musicStatus.value = result;
30015
+ });
30015
30016
  }
30016
30017
  else {
30017
30018
  musicStatus.value = true;
@@ -30324,6 +30325,7 @@
30324
30325
  }
30325
30326
 
30326
30327
  script$2.render = render$2;
30328
+ script$2.__scopeId = "data-v-3bcd7a62";
30327
30329
  script$2.__file = "src/components/WorkRenderH5/WorkRenderH5.vue";
30328
30330
 
30329
30331
  script$2.install = (app) => {
@@ -30470,7 +30472,9 @@
30470
30472
  const handleFirstInteraction = () => {
30471
30473
  const currentState = getCurrentMusicState();
30472
30474
  if (!currentState.isPlaying && global.value.music.url) {
30473
- playOnInteraction();
30475
+ playOnInteraction().then(result => {
30476
+ musicStatus.value = result;
30477
+ });
30474
30478
  }
30475
30479
  else {
30476
30480
  musicStatus.value = true;
@@ -30814,6 +30818,7 @@
30814
30818
  }
30815
30819
 
30816
30820
  script$1.render = render$1;
30821
+ script$1.__scopeId = "data-v-f435efa2";
30817
30822
  script$1.__file = "src/components/WorkRenderLong/WorkRenderLong.vue";
30818
30823
 
30819
30824
  script$1.install = (app) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unika-components",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "private": false,
5
5
  "main": "dist/unika-components.umd.js",
6
6
  "module": "dist/unika-components.esm.js",