@94ai/nf-audio 3.3.68 → 3.3.70

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.
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PluginObject } from 'vue-demi';
2
- declare const _default: import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{}, Readonly<import("vue-demi").ExtractPropTypes<{}>>, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}, {}, true, import("vue-demi").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{}>>> & import("vue-demi").ShallowUnwrapRef<any> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{}>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue-demi").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{}>>, any, {}, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, {}> & {
2
+ declare const _default: import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{}, Readonly<import("vue-demi").ExtractPropTypes<{}>>, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}, {}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{}>>> & import("vue-demi").ShallowUnwrapRef<any> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{}>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{}>>, any, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, {}> & {
3
3
  props: {};
4
4
  } & PluginObject<undefined>;
5
5
  export default _default;
@@ -35,7 +35,7 @@ const _sfc_main = {
35
35
  },
36
36
  unloadTip: {
37
37
  type: String,
38
- default: "音频还未加载完成"
38
+ default: "音频资源暂无法播放"
39
39
  },
40
40
  disabled: {
41
41
  type: Boolean,
@@ -373,7 +373,7 @@ const _sfc_main = {
373
373
  },
374
374
  betweenPlay() {
375
375
  if (!this.disabled) {
376
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
376
+ if (this.checkAudioEffectNull()) {
377
377
  nfMessage.Message.warning(this.unloadTip);
378
378
  this.paused = true;
379
379
  this.betweenPlaying = false;
@@ -400,7 +400,7 @@ const _sfc_main = {
400
400
  //点击进度条更新进度
401
401
  clickProgress(e) {
402
402
  if (!this.disabled) {
403
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
403
+ if (this.checkAudioEffectNull()) {
404
404
  if (!this.paused) {
405
405
  nfMessage.Message.warning(this.unloadTip);
406
406
  }
@@ -422,7 +422,7 @@ const _sfc_main = {
422
422
  //鼠标弹起
423
423
  handleMouseup() {
424
424
  if (!this.disabled) {
425
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
425
+ if (this.checkAudioEffectNull()) {
426
426
  nfMessage.Message.warning(this.unloadTip);
427
427
  this.paused = true;
428
428
  this.betweenPlaying = false;
@@ -443,6 +443,9 @@ const _sfc_main = {
443
443
  //调整进度
444
444
  handleMousedown() {
445
445
  if (!this.disabled) {
446
+ if (this.checkAudioEffectNull()) {
447
+ return;
448
+ }
446
449
  this.pauseAudio();
447
450
  this.paused = true;
448
451
  this.betweenPlaying = false;
@@ -481,10 +484,13 @@ const _sfc_main = {
481
484
  this.$refs.progressBar.style.left = MoveX - this.$refs.progressBar.clientWidth / 2 + "px";
482
485
  }
483
486
  },
487
+ checkAudioEffectNull() {
488
+ return this.audio.duration === 0 || Number.isNaN(this.audio.duration);
489
+ },
484
490
  jumpToTime(time) {
485
491
  if (!this.disabled) {
486
492
  this.pauseAudio();
487
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
493
+ if (this.checkAudioEffectNull()) {
488
494
  nfMessage.Message.warning(this.unloadTip);
489
495
  this.paused = true;
490
496
  this.betweenPlaying = false;
@@ -33,7 +33,7 @@ const _sfc_main = {
33
33
  },
34
34
  unloadTip: {
35
35
  type: String,
36
- default: "音频还未加载完成"
36
+ default: "音频资源暂无法播放"
37
37
  },
38
38
  disabled: {
39
39
  type: Boolean,
@@ -371,7 +371,7 @@ const _sfc_main = {
371
371
  },
372
372
  betweenPlay() {
373
373
  if (!this.disabled) {
374
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
374
+ if (this.checkAudioEffectNull()) {
375
375
  Message.warning(this.unloadTip);
376
376
  this.paused = true;
377
377
  this.betweenPlaying = false;
@@ -398,7 +398,7 @@ const _sfc_main = {
398
398
  //点击进度条更新进度
399
399
  clickProgress(e) {
400
400
  if (!this.disabled) {
401
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
401
+ if (this.checkAudioEffectNull()) {
402
402
  if (!this.paused) {
403
403
  Message.warning(this.unloadTip);
404
404
  }
@@ -420,7 +420,7 @@ const _sfc_main = {
420
420
  //鼠标弹起
421
421
  handleMouseup() {
422
422
  if (!this.disabled) {
423
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
423
+ if (this.checkAudioEffectNull()) {
424
424
  Message.warning(this.unloadTip);
425
425
  this.paused = true;
426
426
  this.betweenPlaying = false;
@@ -441,6 +441,9 @@ const _sfc_main = {
441
441
  //调整进度
442
442
  handleMousedown() {
443
443
  if (!this.disabled) {
444
+ if (this.checkAudioEffectNull()) {
445
+ return;
446
+ }
444
447
  this.pauseAudio();
445
448
  this.paused = true;
446
449
  this.betweenPlaying = false;
@@ -479,10 +482,13 @@ const _sfc_main = {
479
482
  this.$refs.progressBar.style.left = MoveX - this.$refs.progressBar.clientWidth / 2 + "px";
480
483
  }
481
484
  },
485
+ checkAudioEffectNull() {
486
+ return this.audio.duration === 0 || Number.isNaN(this.audio.duration);
487
+ },
482
488
  jumpToTime(time) {
483
489
  if (!this.disabled) {
484
490
  this.pauseAudio();
485
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
491
+ if (this.checkAudioEffectNull()) {
486
492
  Message.warning(this.unloadTip);
487
493
  this.paused = true;
488
494
  this.betweenPlaying = false;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare var _default: import("vue").DefineComponent<{}, any, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -193,7 +193,7 @@ export default {
193
193
  },
194
194
  unloadTip: {
195
195
  type: String,
196
- default: '音频还未加载完成'
196
+ default: '音频资源暂无法播放'
197
197
  },
198
198
  disabled: {
199
199
  type: Boolean,
@@ -537,7 +537,7 @@ export default {
537
537
  },
538
538
  betweenPlay() {
539
539
  if (!this.disabled) {
540
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
540
+ if (this.checkAudioEffectNull()) {
541
541
  Message.warning(this.unloadTip)
542
542
  this.paused = true
543
543
  this.betweenPlaying = false
@@ -564,7 +564,7 @@ export default {
564
564
  //点击进度条更新进度
565
565
  clickProgress(e) {
566
566
  if (!this.disabled) {
567
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
567
+ if (this.checkAudioEffectNull()) {
568
568
  if (!this.paused) {
569
569
  Message.warning(this.unloadTip)
570
570
  }
@@ -589,7 +589,7 @@ export default {
589
589
  //鼠标弹起
590
590
  handleMouseup() {
591
591
  if (!this.disabled) {
592
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
592
+ if (this.checkAudioEffectNull()) {
593
593
  Message.warning(this.unloadTip)
594
594
  this.paused = true
595
595
  this.betweenPlaying = false
@@ -610,6 +610,9 @@ export default {
610
610
  //调整进度
611
611
  handleMousedown() {
612
612
  if (!this.disabled) {
613
+ if (this.checkAudioEffectNull()) {
614
+ return
615
+ }
613
616
  this.pauseAudio()
614
617
  this.paused = true
615
618
  this.betweenPlaying = false
@@ -655,10 +658,13 @@ export default {
655
658
  this.$refs.progressBar.style.left = MoveX - (this.$refs.progressBar.clientWidth / 2) + 'px'
656
659
  }
657
660
  },
661
+ checkAudioEffectNull() {
662
+ return this.audio.duration === 0 || Number.isNaN(this.audio.duration)
663
+ },
658
664
  jumpToTime(time) {
659
665
  if (!this.disabled) {
660
666
  this.pauseAudio()
661
- if (this.audio.duration === 0 || Number.isNaN(this.audio.duration)) {
667
+ if (this.checkAudioEffectNull()) {
662
668
  Message.warning(this.unloadTip)
663
669
  this.paused = true
664
670
  this.betweenPlaying = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-audio",
3
- "version": "3.3.68",
3
+ "version": "3.3.70",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "liuxiangxiang <liuxiangxiang@94ai.com>",
@@ -14,7 +14,7 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-theme-chalk": "^3.3.68",
17
+ "@94ai/nf-theme-chalk": "^3.3.70",
18
18
  "vue-demi": "^0.14.5"
19
19
  },
20
20
  "peerDependenciesMeta": {
@@ -30,5 +30,5 @@
30
30
  "types": "lib/index.d.ts",
31
31
  "main": "lib/nf-audio.cjs.js",
32
32
  "module": "lib/nf-audio.esm-bundler.js",
33
- "gitHead": "2c752dc6246ba8252562937829c091ae21cca8f2"
33
+ "gitHead": "1bf946dcf2e1977ee3779c3d1c7d204e161e3b71"
34
34
  }