@94ai/nf-audio 3.3.53 → 3.3.59

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