|
@@ -15,11 +15,14 @@
|
|
:format-tooltip="formatProcessToolTip"
|
|
:format-tooltip="formatProcessToolTip"
|
|
@change="changeCurrentTime"
|
|
@change="changeCurrentTime"
|
|
/>
|
|
/>
|
|
- <span><template v-if="audio.playing">-</template>{{
|
|
|
|
- audio.maxTime
|
|
|
|
- ? realFormatSecond(audio.maxTime - audio.currentTime)
|
|
|
|
- : ""
|
|
|
|
- }}</span>
|
|
|
|
|
|
+ <span
|
|
|
|
+ ><template v-if="audio.playing">-</template
|
|
|
|
+ >{{
|
|
|
|
+ audio.maxTime
|
|
|
|
+ ? realFormatSecond(audio.maxTime - audio.currentTime)
|
|
|
|
+ : ""
|
|
|
|
+ }}</span
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
<div v-else class="audioLine2">
|
|
<div v-else class="audioLine2">
|
|
@@ -29,8 +32,8 @@
|
|
audio.loading
|
|
audio.loading
|
|
? 'loadBtn'
|
|
? 'loadBtn'
|
|
: audio.playing
|
|
: audio.playing
|
|
- ? 'playBtn-icon'
|
|
|
|
- : 'pauseBtn-icon'
|
|
|
|
|
|
+ ? 'playBtn-icon'
|
|
|
|
+ : 'pauseBtn-icon'
|
|
"
|
|
"
|
|
@click="PlayAudio"
|
|
@click="PlayAudio"
|
|
/>
|
|
/>
|
|
@@ -125,7 +128,6 @@ export default {
|
|
let _this = this;
|
|
let _this = this;
|
|
let audioId = _this.audioId;
|
|
let audioId = _this.audioId;
|
|
_this.$refs[audioId].addEventListener("loadstart", function () {
|
|
_this.$refs[audioId].addEventListener("loadstart", function () {
|
|
- console.log("音频开始加载");
|
|
|
|
_this.loading = _this.$loading({
|
|
_this.loading = _this.$loading({
|
|
lock: true,
|
|
lock: true,
|
|
text: "Loading",
|
|
text: "Loading",
|
|
@@ -134,7 +136,6 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
_this.$refs[audioId].addEventListener("play", function () {
|
|
_this.$refs[audioId].addEventListener("play", function () {
|
|
- console.log("音频开始播放了");
|
|
|
|
_this.audio.playing = true;
|
|
_this.audio.playing = true;
|
|
_this.audio.isPlaying = true;
|
|
_this.audio.isPlaying = true;
|
|
_this.audio.loading = false;
|
|
_this.audio.loading = false;
|
|
@@ -171,7 +172,7 @@ export default {
|
|
PlayAudio() {
|
|
PlayAudio() {
|
|
let audioId = this.audioId;
|
|
let audioId = this.audioId;
|
|
let audio = document.getElementsByTagName("audio");
|
|
let audio = document.getElementsByTagName("audio");
|
|
- audio.forEach(item => {
|
|
|
|
|
|
+ audio.forEach((item) => {
|
|
if (item.src == this.mp3) {
|
|
if (item.src == this.mp3) {
|
|
if (item.id !== audioId) {
|
|
if (item.id !== audioId) {
|
|
item.pause();
|
|
item.pause();
|
|
@@ -181,7 +182,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
let video = document.getElementsByTagName("video");
|
|
let video = document.getElementsByTagName("video");
|
|
- video.forEach(vItem => {
|
|
|
|
|
|
+ video.forEach((vItem) => {
|
|
vItem.pause();
|
|
vItem.pause();
|
|
});
|
|
});
|
|
|
|
|
|
@@ -207,7 +208,6 @@ export default {
|
|
oncanplaythrough() {
|
|
oncanplaythrough() {
|
|
let _this = this;
|
|
let _this = this;
|
|
// setTimeout(() => {
|
|
// setTimeout(() => {
|
|
- console.log("音频加载完成");
|
|
|
|
_this.audio.loading = false;
|
|
_this.audio.loading = false;
|
|
_this.loading.close();
|
|
_this.loading.close();
|
|
|
|
|
|
@@ -254,7 +254,7 @@ export default {
|
|
this.playValue = (res / this.audio.maxTime) * 100;
|
|
this.playValue = (res / this.audio.maxTime) * 100;
|
|
if (playFlag) {
|
|
if (playFlag) {
|
|
let audio = document.getElementsByTagName("audio");
|
|
let audio = document.getElementsByTagName("audio");
|
|
- audio.forEach(item => {
|
|
|
|
|
|
+ audio.forEach((item) => {
|
|
if (item.id !== audioId) {
|
|
if (item.id !== audioId) {
|
|
item.pause();
|
|
item.pause();
|
|
}
|
|
}
|