@94ai/nf-audio 3.3.53 → 3.3.55

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.
@@ -1,219 +1,147 @@
1
- import { ref, watch, onUnmounted } from "vue-demi";
2
- import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
3
1
  import { Message } from "@94ai/nf-message";
4
- const __sfc_main = {};
5
- __sfc_main.props = {
6
- visible: [Boolean, String],
7
- disabled: [Boolean]
8
- };
9
- __sfc_main.setup = (__props, __ctx) => {
10
- const emits = __ctx.emit;
11
- const props = __props;
12
- const reference = ref();
13
- const popperRef = ref();
14
- watch(() => props.visible, (newValue) => {
15
- if (newValue) {
16
- window.addEventListener("mousedown", docClick);
17
- } else {
18
- window.removeEventListener("mousedown", docClick);
19
- }
20
- });
21
- function docClick(e) {
22
- if (popperRef.value.contains(e.target) || reference.value.contains(e.target)) {
23
- return;
24
- }
25
- emits("update:visible", false);
26
- }
27
- function showPopper() {
28
- if (!props.disabled) {
29
- emits("update:visible", true);
30
- }
31
- }
32
- onUnmounted(() => {
33
- emits("update:visible", false);
34
- });
35
- return Object.assign({
36
- reference,
37
- popperRef,
38
- showPopper
39
- }, {
40
- showPopper
41
- });
42
- };
43
- const _sfc_main$2 = __sfc_main;
44
- var _sfc_render$2 = function render() {
45
- var _vm = this, _c = _vm._self._c;
46
- _vm._self._setupProxy;
47
- return _c("div", {
48
- staticClass: "nf-volume-tool",
49
- class: _vm.visible ? "nf-tool-show" : "nf-tool-hide",
50
- on: {
51
- "click": _vm.showPopper
52
- }
53
- }, [_c("div", {
54
- ref: "reference"
55
- }, [_vm._t("reference")], 2), _c("transition", {
56
- attrs: {
57
- "name": "slide-fade"
58
- }
59
- }, [_c("div", {
60
- directives: [{
61
- name: "show",
62
- rawName: "v-show",
63
- value: _vm.visible,
64
- expression: "visible"
65
- }],
66
- ref: "popperRef",
67
- staticClass: "nf-popper"
68
- }, [_vm._t("default")], 2)])], 1);
69
- };
70
- var _sfc_staticRenderFns$2 = [];
71
- var __component__$2 = /* @__PURE__ */ normalizeComponent(_sfc_main$2, _sfc_render$2, _sfc_staticRenderFns$2, false, null, null, null, null);
72
- const volumeTool = __component__$2.exports;
73
- const _sfc_main$1 = {
74
- name: "more-btn",
75
- components: {},
2
+ import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
3
+ function timeFormat(value) {
4
+ const minute = parseInt(String(value / 60));
5
+ const second = parseInt(String(value % 60));
6
+ return (minute >= 10 ? minute : "0" + minute) + ":" + (second >= 10 ? second : "0" + second);
7
+ }
8
+ const _sfc_main = {
9
+ name: "nf-audio",
76
10
  props: {
77
- disabled: {
78
- type: Boolean,
79
- default: false
80
- }
81
- },
82
- data() {
83
- return {
84
- multipleArray: ["1.0", "1.25", "1.5", "1.75", "2.0"],
85
- speed: ""
86
- };
87
- },
88
- mounted() {
89
- },
90
- methods: {
91
- handleDown() {
92
- this.$emit("down");
11
+ size: {
12
+ type: String
93
13
  },
94
- handleSpeed(speed) {
95
- this.speed = speed;
96
- this.$emit("speed", speed);
97
- }
98
- }
99
- };
100
- var _sfc_render$1 = function render2() {
101
- var _vm = this, _c = _vm._self._c;
102
- return _c("div", {
103
- staticClass: "more-btn-box"
104
- }, [_c("el-popover", {
105
- attrs: {
106
- "placement": "right",
107
- "popper-class": "audio-popover",
108
- "disabled": _vm.disabled
109
- }
110
- }, [_c("div", {
111
- staticClass: "audio-btn-list"
112
- }, [_c("el-popover", {
113
- attrs: {
114
- "placement": "right",
115
- "popper-class": "audio-popover"
116
- }
117
- }, [_c("div", {
118
- staticClass: "audio-btn-list"
119
- }, _vm._l(_vm.multipleArray, function(item, index) {
120
- return _c("div", {
121
- key: index,
122
- staticClass: "btn-item",
123
- class: _vm.speed === item ? "active" : "",
124
- on: {
125
- "click": function($event) {
126
- return _vm.handleSpeed(item);
127
- }
128
- }
129
- }, [_vm._v("x " + _vm._s(item))]);
130
- }), 0), _c("div", {
131
- staticClass: "btn-item",
132
- attrs: {
133
- "slot": "reference"
14
+ speedDesc: {
15
+ type: String,
16
+ default: "倍速"
134
17
  },
135
- slot: "reference"
136
- }, [_vm._v("倍速")])]), _c("div", {
137
- staticClass: "btn-item",
138
- on: {
139
- "click": _vm.handleDown
140
- }
141
- }, [_vm._v("下载")])], 1), _c("div", {
142
- staticClass: "more-icon",
143
- attrs: {
144
- "slot": "reference"
18
+ downloadDesc: {
19
+ type: String,
20
+ default: "下载"
21
+ },
22
+ speedPreDesc: {
23
+ type: String,
24
+ default: "x "
25
+ },
26
+ crossTimeTip: {
27
+ type: String,
28
+ default: "开始时间不能大于总时长"
29
+ },
30
+ unloadTip: {
31
+ type: String,
32
+ default: "音频还未加载完成"
145
33
  },
146
- slot: "reference"
147
- }, [_c("i", {
148
- staticClass: "iconfont icon-gengduo1 more-btn"
149
- })])])], 1);
150
- };
151
- var _sfc_staticRenderFns$1 = [];
152
- var __component__$1 = /* @__PURE__ */ normalizeComponent(_sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
153
- const moreBtn = __component__$1.exports;
154
- const _sfc_main = {
155
- name: "nf-audio",
156
- components: {
157
- volumeTool,
158
- moreBtn
159
- },
160
- props: {
161
34
  disabled: {
162
35
  type: Boolean,
163
36
  default: false
164
37
  },
165
- showMoreBtn: {
38
+ background: {
166
39
  type: Boolean,
167
40
  default: true
168
41
  },
169
- showJumpToTime: {
42
+ // 音频地址
43
+ src: {
44
+ type: String,
45
+ default: ""
46
+ },
47
+ // 更多功能
48
+ showMoreBtn: {
170
49
  type: Boolean,
171
50
  default: true
172
51
  },
173
- audioSrc: {
174
- type: String,
175
- default: ""
52
+ // 跳转时间
53
+ jumpTime: {
54
+ type: Number,
55
+ default: 0
176
56
  },
57
+ // 快退秒数
177
58
  backSecond: {
178
59
  type: Number,
179
- default: 3
60
+ default: 0
180
61
  },
62
+ // 快进秒数
181
63
  forwardSecond: {
182
64
  type: Number,
183
- default: 10
65
+ default: 0
66
+ },
67
+ // 速度调整
68
+ multipleArray: {
69
+ type: Array,
70
+ default() {
71
+ return ["1.0", "1.25", "1.5", "1.75", "2.0", "2.5", "3.0", "3.5", "4.0"];
72
+ }
73
+ },
74
+ // 默认速度
75
+ initSpeedValue: {
76
+ type: Number,
77
+ default: 1
184
78
  },
185
- startTime: {
79
+ initVolumnValue: {
186
80
  type: Number,
187
- default: 0
81
+ default: 0.8
188
82
  }
189
83
  },
190
84
  data() {
191
85
  return {
192
- duration: "00:00",
193
- currentDuration: "00:00",
194
- audio: "",
195
- volume: 0.8,
86
+ // 播放还是暂停
196
87
  paused: true,
197
- showVolumePanel: false,
198
- volumeVisible: false,
88
+ moveMin: 0,
89
+ moveMax: 0,
90
+ progressBarWidth: 0,
91
+ // 总播放时间
92
+ totalTime: "00:00",
93
+ // 当前播放时间
94
+ currentTime: "00:00",
95
+ // 调整播放音量比例
199
96
  volumeValue: 80,
97
+ // 音量
98
+ volume: 0.8,
99
+ // 音量调节面板
100
+ volumeVisible: false,
101
+ // 播放速度
200
102
  speed: 1
201
103
  };
202
104
  },
105
+ computed: {
106
+ audio() {
107
+ return this.$refs.audio;
108
+ }
109
+ },
203
110
  mounted() {
204
- this.audio = this.$refs.audio;
111
+ this.speed = this.initSpeedValue;
112
+ this.volume = this.initVolumnValue;
113
+ this.volumeValue = this.initVolumnValue * 100;
205
114
  },
206
115
  methods: {
116
+ docClick(e) {
117
+ if (this.$refs.popperRef.contains(e.target) || this.$refs.reference.contains(e.target)) {
118
+ return;
119
+ }
120
+ this.volumeVisible = false;
121
+ },
122
+ showPopper() {
123
+ if (!this.disabled) {
124
+ this.volumeVisible = !this.volumeVisible;
125
+ }
126
+ },
207
127
  //后退
208
128
  handleBack() {
209
- if (this.audio.currentTime > this.backSecond) {
210
- this.audio.currentTime = this.audio.currentTime - this.backSecond;
129
+ if (this.audio.currentTime - this.backSecond <= 0) {
130
+ this.jumpToTime(0);
131
+ } else {
132
+ if (this.audio.currentTime < this.audio.duration) {
133
+ this.jumpToTime(this.audio.currentTime - this.backSecond);
134
+ }
211
135
  }
212
136
  },
213
137
  //前进
214
138
  handleForward() {
215
- if (this.audio.duration - this.audio.currentTime > this.forwardSecond) {
216
- this.audio.currentTime = this.audio.currentTime + 10;
139
+ if (this.audio.currentTime + this.forwardSecond <= this.audio.duration) {
140
+ this.jumpToTime(this.audio.currentTime + this.forwardSecond);
141
+ } else {
142
+ if (this.audio.currentTime < this.audio.duration) {
143
+ this.jumpToTime(this.audio.duration);
144
+ }
217
145
  }
218
146
  },
219
147
  //暂停或播放
@@ -225,44 +153,37 @@ const _sfc_main = {
225
153
  this.paused = !this.paused;
226
154
  } else {
227
155
  console.log("Audio is not ready yet.");
228
- Message.warning("音频还未加载完成");
156
+ Message.warning(this.unloadTip);
229
157
  }
230
158
  }
231
159
  },
232
160
  //视频在可以播放时触发
233
161
  getDuration() {
234
- this.duration = this.timeFormat(this.$refs.audio.duration);
162
+ this.totalTime = timeFormat(this.audio.duration);
235
163
  this.audio.volume = this.volume;
236
164
  },
237
- //将单位为秒的的时间转换成mm:ss的形式
238
- timeFormat(number) {
239
- let minute = parseInt(number / 60);
240
- let second = parseInt(number % 60);
241
- minute = minute >= 10 ? minute : "0" + minute;
242
- second = second >= 10 ? second : "0" + second;
243
- return minute + ":" + second;
244
- },
245
165
  //进度条发生变化时触发
246
166
  updateTime() {
247
- if (!this.$refs.progress)
167
+ if (!this.$refs.progressContainer)
248
168
  return;
249
- this.currentDuration = this.timeFormat(this.audio.currentTime);
169
+ this.currentTime = timeFormat(this.audio.currentTime);
250
170
  if (!this.audio.paused) {
251
- let MoveX = this.$refs.progress.clientWidth * (this.audio.currentTime / this.audio.duration);
252
- this.$refs.currentProgress.style.width = MoveX + "px";
253
- this.$refs.circle.style.left = MoveX - this.$refs.circle.clientWidth / 2 + "px";
171
+ let MoveX = this.$refs.progressContainer.clientWidth * (this.audio.currentTime / this.audio.duration);
172
+ this.$refs.progressCurrent.style.width = MoveX + "px";
173
+ this.$refs.progressBar.style.left = MoveX - this.$refs.progressBar.clientWidth / 2 + "px";
254
174
  this.paused = false;
255
175
  }
256
176
  },
257
177
  handleAudioEnded() {
258
- console.log("音频播放完毕!");
178
+ this.$refs.progressCurrent.style.width = this.$refs.progressContainer.clientWidth + "px";
179
+ this.$refs.progressBar.style.left = this.$refs.progressContainer.clientWidth - this.$refs.progressBar.clientWidth / 2 + "px";
259
180
  this.paused = true;
260
181
  },
261
182
  //点击进度条更新进度
262
183
  clickProgress(e) {
263
184
  if (!this.disabled) {
264
- if (this.duration === "00:00") {
265
- Message.warning("音频还未加载完成");
185
+ if (this.audio.duration === 0) {
186
+ Message.warning(this.unloadTip);
266
187
  return false;
267
188
  }
268
189
  if (!this.audio.paused) {
@@ -272,100 +193,95 @@ const _sfc_main = {
272
193
  },
273
194
  //更新进度
274
195
  updateProgress(MoveX) {
275
- let clickProgress = MoveX / this.$refs.progress.clientWidth;
196
+ const clickProgress = MoveX / this.$refs.progressContainer.clientWidth;
276
197
  this.audio.currentTime = this.audio.duration * clickProgress;
277
- this.$refs.currentProgress.style.width = MoveX + "px";
278
- this.$refs.circle.style.left = MoveX - this.$refs.circle.clientWidth / 2 + "px";
198
+ this.$refs.progressCurrent.style.width = MoveX + "px";
199
+ this.$refs.progressBar.style.left = MoveX - this.$refs.progressBar.clientWidth / 2 + "px";
279
200
  },
280
201
  //鼠标弹起
281
202
  handleMouseup() {
282
203
  if (!this.disabled) {
283
- if (this.duration === "00:00") {
284
- Message.warning("音频还未加载完成");
204
+ if (this.audio.duration === 0) {
205
+ Message.warning(this.unloadTip);
285
206
  return false;
286
207
  }
287
- const timer = setTimeout(() => {
288
- this.audio.play();
289
- this.paused = false;
290
- clearTimeout(timer);
291
- }, 200);
292
- this.$once("hook:beforeDestroy", () => {
293
- clearTimeout(timer);
294
- });
208
+ this.audio.play();
209
+ this.paused = false;
295
210
  }
296
211
  },
212
+ moveX(e) {
213
+ if (e.pageX >= this.moveMax) {
214
+ return;
215
+ } else if (e.pageX <= this.moveMin) {
216
+ return;
217
+ }
218
+ this.$refs.progressBar.style.left = e.pageX - this.moveMin - this.progressBarWidth + "px";
219
+ this.updateProgress(e.pageX - this.moveMin);
220
+ },
297
221
  //调整进度
298
222
  handleMousedown() {
299
223
  if (!this.disabled) {
300
224
  this.audio.pause();
301
225
  this.paused = true;
302
- let progress = this.$refs.progress;
303
- let moveMin = progress.offsetParent.offsetLeft + progress.offsetLeft;
304
- let moveMax = progress.offsetParent.offsetLeft + progress.offsetLeft + progress.clientWidth;
305
- let circleWidth = this.$refs.circle.clientWidth / 2;
306
- let moveX = (e) => {
307
- if (e.pageX >= moveMax) {
308
- return;
309
- } else if (e.pageX <= moveMin) {
310
- return;
311
- }
312
- this.$refs.circle.style.left = e.pageX - moveMin - circleWidth + "px";
313
- this.updateProgress(e.pageX - moveMin);
314
- };
315
- document.addEventListener("mousemove", moveX);
226
+ const progressContainer = this.$refs.progressContainer;
227
+ this.moveMin = progressContainer.offsetParent.offsetLeft + progressContainer.offsetLeft;
228
+ this.moveMax = progressContainer.offsetParent.offsetLeft + progressContainer.offsetLeft + progressContainer.clientWidth;
229
+ this.progressBarWidth = this.$refs.progressBar.clientWidth / 2;
230
+ document.addEventListener("mousemove", this.moveX);
316
231
  document.addEventListener("mouseup", () => {
317
- document.removeEventListener("mousemove", moveX);
232
+ document.removeEventListener("mousemove", this.moveX);
318
233
  });
319
234
  }
320
235
  },
321
- rangeVolume(val) {
322
- console.log(val);
236
+ volumeChange(val) {
237
+ this.$emit("volumeChange", val);
323
238
  },
324
239
  /** 设置倍速播放 */
325
- changeSpeed(command) {
240
+ changeSpeed(speed) {
326
241
  if (!this.disabled) {
327
- const audioPlayer = this.$refs.audio;
328
- if (audioPlayer) {
329
- audioPlayer.playbackRate = command;
242
+ if (this.audio) {
243
+ this.audio.playbackRate = speed;
330
244
  }
331
- this.speed = command;
245
+ this.speed = speed;
246
+ this.$emit("speedChange", speed);
332
247
  }
333
248
  },
334
- downRecord() {
249
+ downRecord(e) {
335
250
  if (!this.disabled) {
336
- this.$emit("downloadCallback");
251
+ this.$emit("download", e);
337
252
  }
338
253
  },
339
254
  calcMoveX() {
340
255
  if (!this.audio.paused) {
341
- let MoveX = this.$refs.progress.clientWidth * (this.audio.currentTime / this.audio.duration);
342
- this.$refs.currentProgress.style.width = MoveX + "px";
343
- this.$refs.circle.style.left = MoveX - this.$refs.circle.clientWidth / 2 + "px";
256
+ let MoveX = this.$refs.progressContainer.clientWidth * (this.audio.currentTime / this.audio.duration);
257
+ this.$refs.progressCurrent.style.width = MoveX + "px";
258
+ this.$refs.progressBar.style.left = MoveX - this.$refs.progressBar.clientWidth / 2 + "px";
344
259
  }
345
260
  },
346
- jumpToTime() {
261
+ jumpToTime(time) {
347
262
  if (!this.disabled) {
348
263
  this.audio.pause();
349
- const formatStartT = this.timeFormat(this.startTime);
350
- if (this.duration === "00:00") {
351
- Message.warning("音频还未加载完成");
264
+ if (this.audio.duration === 0) {
265
+ Message.warning(this.unloadTip);
352
266
  return false;
353
267
  }
354
- if (formatStartT >= this.duration) {
355
- this.audio.currentTime = this.duration;
356
- this.currentDuration = this.timeFormat(this.audio.currentTime);
268
+ if (time >= this.audio.duration) {
269
+ this.audio.currentTime = this.audio.duration;
270
+ this.currentTime = timeFormat(this.audio.currentTime);
357
271
  this.calcMoveX();
358
272
  this.audio.play();
359
- console.error("开始时间不能大于总时长");
273
+ if (time > this.audio.duration) {
274
+ console.error(this.crossTimeTip);
275
+ }
360
276
  return false;
361
- } else if (formatStartT >= "00:00" && formatStartT < this.duration) {
362
- this.audio.currentTime = this.startTime;
363
- this.currentDuration = this.timeFormat(this.audio.currentTime);
277
+ } else if (time >= 0 && time < this.audio.duration) {
278
+ this.audio.currentTime = time;
279
+ this.currentTime = timeFormat(this.audio.currentTime);
364
280
  this.calcMoveX();
365
281
  this.audio.play();
366
282
  } else {
367
283
  this.audio.currentTime = 0;
368
- this.currentDuration = this.timeFormat(this.audio.currentTime);
284
+ this.currentTime = timeFormat(this.audio.currentTime);
369
285
  this.calcMoveX();
370
286
  this.audio.play();
371
287
  }
@@ -373,18 +289,38 @@ const _sfc_main = {
373
289
  }
374
290
  },
375
291
  watch: {
292
+ initSpeedValue: {
293
+ handle() {
294
+ this.speed = this.initSpeedValue;
295
+ }
296
+ },
297
+ initVolumnValue: {
298
+ handle() {
299
+ this.volume = this.initVolumnValue;
300
+ this.volumeValue = this.initVolumnValue * 100;
301
+ }
302
+ },
303
+ volumeVisible(val) {
304
+ if (val) {
305
+ window.addEventListener("mousedown", this.docClick);
306
+ } else {
307
+ window.removeEventListener("mousedown", this.docClick);
308
+ }
309
+ },
376
310
  volumeValue(val) {
377
311
  this.volume = val / 100;
378
312
  this.audio.volume = val / 100;
379
313
  }
380
314
  }
381
315
  };
382
- var _sfc_render = function render3() {
316
+ var _sfc_render = function render() {
383
317
  var _vm = this, _c = _vm._self._c;
384
318
  return _c("div", {
385
- staticClass: "nf-audio-strip",
319
+ staticClass: "nf-audio",
386
320
  class: {
387
- disabled: _vm.disabled
321
+ disabled: _vm.disabled,
322
+ [_vm.size]: true,
323
+ background: _vm.background
388
324
  }
389
325
  }, [_c("audio", {
390
326
  directives: [{
@@ -397,120 +333,252 @@ var _sfc_render = function render3() {
397
333
  attrs: {
398
334
  "controls": "",
399
335
  "crossOrigin": "anonymous",
400
- "src": _vm.audioSrc
336
+ "src": _vm.src
401
337
  },
402
338
  on: {
403
339
  "canplay": _vm.getDuration,
404
340
  "timeupdate": _vm.updateTime,
405
341
  "ended": _vm.handleAudioEnded
406
342
  }
407
- }), _vm.showJumpToTime ? _c("div", {
408
- staticClass: "nf-fast"
409
- }, [_c("i", {
410
- staticClass: "iconfont icon-zanting1 nf-fast-icon",
411
- on: {
412
- "click": _vm.jumpToTime
413
- }
414
- })]) : _vm._e(), _c("div", {
415
- staticClass: "nf-audio"
416
- }, [_c("div", {
417
- staticClass: "play",
418
- on: {
419
- "click": _vm.handlePauseOrPlay
420
- }
421
- }, [_c("i", {
422
- directives: [{
423
- name: "show",
424
- rawName: "v-show",
425
- value: !_vm.paused,
426
- expression: "!paused"
427
- }],
428
- staticClass: "iconfont icon-zanting2 pause-icon"
429
- }), _c("i", {
430
- directives: [{
431
- name: "show",
432
- rawName: "v-show",
433
- value: _vm.paused,
434
- expression: "paused"
435
- }],
436
- staticClass: "iconfont icon-bofang1 play-icon"
437
- })]), _c("div", {
438
- staticClass: "time"
439
- }, [_c("span", {
440
- staticClass: "startTime"
441
- }, [_vm._v(_vm._s(_vm.currentDuration))]), _vm._v("/ "), _c("span", {
442
- staticClass: "endTime"
443
- }, [_vm._v(_vm._s(_vm.duration))])]), _c("div", {
444
- ref: "progress",
445
- staticClass: "progress",
446
- on: {
447
- "click": _vm.clickProgress,
448
- "mouseup": _vm.handleMouseup
449
- }
450
- }, [_c("div", {
451
- ref: "currentProgress",
452
- staticClass: "currentProgress"
453
- }, [_c("span", {
454
- ref: "circle",
455
- staticClass: "circle",
456
- on: {
457
- "mousedown": _vm.handleMousedown
458
- }
459
- })])]), _c("div", {
460
- staticClass: "nf-volume-panel"
461
- }, [_c("volumeTool", {
462
- attrs: {
463
- "visible": _vm.volumeVisible,
464
- "disabled": _vm.disabled
465
- },
466
- on: {
467
- "update:visible": function($event) {
468
- _vm.volumeVisible = $event;
343
+ }), _vm.jumpTime ? _vm._t("jump", function() {
344
+ return [_c("div", {
345
+ staticClass: "nf-audio-fast"
346
+ }, [_c("i", {
347
+ staticClass: "iconfont icon-zanting1 nf-audio-fast-icon",
348
+ on: {
349
+ "click": function($event) {
350
+ return _vm.jumpToTime(_vm.jumpTime);
351
+ }
469
352
  }
470
- },
471
- scopedSlots: _vm._u([{
472
- key: "reference",
473
- fn: function() {
474
- return [_vm.volume == 0 ? _c("i", {
475
- staticClass: "iconfont icon-yinliang_guanbi volume-mute"
476
- }) : _c("i", {
477
- staticClass: "iconfont icon-yinliang_kaiqi volume"
478
- })];
353
+ })])];
354
+ }) : _vm._e(), _c("div", {
355
+ staticClass: "nf-audio-body"
356
+ }, [_vm._t("play", function() {
357
+ return [_c("div", {
358
+ staticClass: "nf-audio-play",
359
+ on: {
360
+ "click": _vm.handlePauseOrPlay
361
+ }
362
+ }, [_c("i", {
363
+ directives: [{
364
+ name: "show",
365
+ rawName: "v-show",
366
+ value: !_vm.paused,
367
+ expression: "!paused"
368
+ }],
369
+ staticClass: "iconfont icon-zanting2 nf-audio-pause-icon"
370
+ }), _c("i", {
371
+ directives: [{
372
+ name: "show",
373
+ rawName: "v-show",
374
+ value: _vm.paused,
375
+ expression: "paused"
376
+ }],
377
+ staticClass: "iconfont icon-bofang1 nf-audio-play-icon"
378
+ })])];
379
+ }, {
380
+ "paused": _vm.paused
381
+ }), _vm._t("time", function() {
382
+ return [_c("div", {
383
+ staticClass: "nf-audio-time"
384
+ }, [_c("span", {
385
+ staticClass: "startTime"
386
+ }, [_vm._v(_vm._s(_vm.currentTime))]), _vm._v("/ "), _c("span", {
387
+ staticClass: "endTime"
388
+ }, [_vm._v(_vm._s(_vm.totalTime))])])];
389
+ }, {
390
+ "currentTime": _vm.currentTime,
391
+ "totalTime": _vm.totalTime
392
+ }), _vm.backSecond ? _vm._t("fastBack", function() {
393
+ return [_c("el-tooltip", {
394
+ staticClass: "nf-audio-pre",
395
+ attrs: {
396
+ "placement": "top",
397
+ "disabled": _vm.disabled
398
+ }
399
+ }, [_c("span", {
400
+ staticStyle: {
401
+ "color": "#C7C7C9",
402
+ "font-size": "13px"
479
403
  },
480
- proxy: true
481
- }])
482
- }, [_c("el-slider", {
483
- class: _vm.volumeValue === 0 ? "volume-mute-slider" : "volume-phonic",
484
- attrs: {
485
- "vertical": "",
486
- "min": 0,
487
- "max": 100,
488
- "show-tooltip": _vm.volumeVisible,
489
- "height": "60px"
490
- },
491
- on: {
492
- "change": _vm.rangeVolume
493
- },
494
- model: {
495
- value: _vm.volumeValue,
496
- callback: function($$v) {
497
- _vm.volumeValue = $$v;
404
+ attrs: {
405
+ "slot": "content"
498
406
  },
499
- expression: "volumeValue"
500
- }
501
- })], 1)], 1), _vm.showMoreBtn ? _c("div", {
502
- staticClass: "option"
503
- }, [_c("moreBtn", {
504
- attrs: {
505
- "disabled": _vm.disabled
506
- },
507
- on: {
508
- "down": function($event) {
509
- return _vm.downRecord();
407
+ slot: "content"
408
+ }, [_vm._v(" -" + _vm._s(_vm.backSecond) + "s ")]), _c("nf-button", {
409
+ staticStyle: {
410
+ "padding": "3px",
411
+ "border-radius": "50%"
510
412
  },
511
- "speed": _vm.changeSpeed
512
- }
513
- })], 1) : _vm._e()])]);
413
+ attrs: {
414
+ "type": "text",
415
+ "disabled": _vm.disabled
416
+ },
417
+ on: {
418
+ "click": _vm.handleBack
419
+ }
420
+ }, [_c("i", {
421
+ staticClass: "el-icon-d-arrow-left"
422
+ })])], 1)];
423
+ }) : _vm._e(), _vm._t("progress", function() {
424
+ return [_c("div", {
425
+ ref: "progressContainer",
426
+ staticClass: "nf-audio-progress-container",
427
+ on: {
428
+ "click": _vm.clickProgress,
429
+ "mouseup": _vm.handleMouseup
430
+ }
431
+ }, [_c("div", {
432
+ ref: "progressCurrent",
433
+ staticClass: "nf-audio-progress-current"
434
+ }, [_c("span", {
435
+ ref: "progressBar",
436
+ staticClass: "nf-audio-progress-bar",
437
+ on: {
438
+ "mousedown": _vm.handleMousedown
439
+ }
440
+ })])])];
441
+ }), _vm.forwardSecond ? _vm._t("fastForward", function() {
442
+ return [_c("el-tooltip", {
443
+ staticClass: "nf-audio-next",
444
+ attrs: {
445
+ "disabled": _vm.disabled
446
+ }
447
+ }, [_c("span", {
448
+ staticStyle: {
449
+ "color": "#C7C7C9",
450
+ "font-size": "13px"
451
+ },
452
+ attrs: {
453
+ "slot": "content"
454
+ },
455
+ slot: "content"
456
+ }, [_vm._v(" +" + _vm._s(_vm.forwardSecond) + "s ")]), _c("nf-button", {
457
+ staticStyle: {
458
+ "padding": "3px",
459
+ "border-radius": "50%"
460
+ },
461
+ attrs: {
462
+ "type": "text",
463
+ "disabled": _vm.disabled
464
+ },
465
+ on: {
466
+ "click": _vm.handleForward
467
+ }
468
+ }, [_c("i", {
469
+ staticClass: "el-icon-d-arrow-right"
470
+ })])], 1)];
471
+ }) : _vm._e(), _vm._t("volume", function() {
472
+ return [_c("div", {
473
+ staticClass: "nf-audio-volume-tool",
474
+ class: _vm.volumeVisible ? "nf-audio-tool-show" : ""
475
+ }, [_c("div", {
476
+ ref: "reference",
477
+ on: {
478
+ "click": _vm.showPopper
479
+ }
480
+ }, [_vm.volume == 0 ? _vm._t("volume-mute", function() {
481
+ return [_c("i", {
482
+ staticClass: "iconfont icon-yinliang_guanbi nf-audio-volume-mute"
483
+ })];
484
+ }) : _vm._t("volume-unmute", function() {
485
+ return [_c("i", {
486
+ staticClass: "iconfont icon-yinliang_kaiqi nf-audio-volume-unmute"
487
+ })];
488
+ })], 2), _c("transition", {
489
+ attrs: {
490
+ "name": "nf-audio-slide-fade"
491
+ }
492
+ }, [_c("div", {
493
+ directives: [{
494
+ name: "show",
495
+ rawName: "v-show",
496
+ value: _vm.volumeVisible,
497
+ expression: "volumeVisible"
498
+ }],
499
+ ref: "popperRef",
500
+ staticClass: "nf-audio-volume-popper"
501
+ }, [_c("el-slider", {
502
+ attrs: {
503
+ "vertical": "",
504
+ "min": 0,
505
+ "max": 100,
506
+ "show-tooltip": _vm.volumeVisible,
507
+ "height": "60px"
508
+ },
509
+ on: {
510
+ "change": _vm.volumeChange
511
+ },
512
+ model: {
513
+ value: _vm.volumeValue,
514
+ callback: function($$v) {
515
+ _vm.volumeValue = $$v;
516
+ },
517
+ expression: "volumeValue"
518
+ }
519
+ })], 1)])], 1)];
520
+ }, {
521
+ "volume": _vm.volume,
522
+ "volumeVisible": _vm.volumeVisible
523
+ }), _vm.showMoreBtn ? _vm._t("more", function() {
524
+ return [_c("div", {
525
+ staticClass: "nf-audio-more-btn-box"
526
+ }, [_c("el-popover", {
527
+ attrs: {
528
+ "placement": "right",
529
+ "popper-class": "nf-audio-popover",
530
+ "append-to-body": false,
531
+ "disabled": _vm.disabled
532
+ }
533
+ }, [_vm._t("more-btn-list", function() {
534
+ return [_c("div", {
535
+ staticClass: "nf-audio-btn-list"
536
+ }, [_c("el-popover", {
537
+ attrs: {
538
+ "placement": "right",
539
+ "popper-class": "nf-audio-popover",
540
+ "append-to-body": false,
541
+ "disabled": _vm.disabled
542
+ }
543
+ }, [_vm._t("speed-btn-list", function() {
544
+ return [_c("div", {
545
+ staticClass: "nf-audio-btn-list"
546
+ }, _vm._l(_vm.multipleArray, function(item, index) {
547
+ return _c("div", {
548
+ key: index,
549
+ staticClass: "nf-audio-btn-item",
550
+ class: _vm.speed === item ? "active" : "",
551
+ on: {
552
+ "click": function($event) {
553
+ return _vm.changeSpeed(item);
554
+ }
555
+ }
556
+ }, [_vm._v(" " + _vm._s(_vm.speedPreDesc) + _vm._s(item) + " ")]);
557
+ }), 0)];
558
+ }), _c("div", {
559
+ staticClass: "nf-audio-btn-item",
560
+ attrs: {
561
+ "slot": "reference"
562
+ },
563
+ slot: "reference"
564
+ }, [_vm._v(_vm._s(_vm.speedDesc))])], 2), _c("div", {
565
+ staticClass: "nf-audio-btn-item",
566
+ on: {
567
+ "click": _vm.downRecord
568
+ }
569
+ }, [_vm._v(_vm._s(_vm.downloadDesc))])], 1)];
570
+ }), _c("div", {
571
+ staticClass: "nf-audio-more-icon-container",
572
+ attrs: {
573
+ "slot": "reference"
574
+ },
575
+ slot: "reference"
576
+ }, [_c("i", {
577
+ staticClass: "iconfont icon-gengduo1 nf-audio-more-icon"
578
+ })])], 2)], 1)];
579
+ }, {
580
+ "showMoreBtn": _vm.showMoreBtn
581
+ }) : _vm._e()], 2)], 2);
514
582
  };
515
583
  var _sfc_staticRenderFns = [];
516
584
  var __component__ = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);