mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Remove semicolon
This commit is contained in:
parent
35f51f4e98
commit
bfcf4e317f
4 changed files with 19 additions and 19 deletions
|
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PlayerHandler from '@/players/PlayerHandler'
|
import PlayerHandler from '@/players/PlayerHandler'
|
||||||
import TranscriptionUi from "@/components/player/TranscriptionUi.vue";
|
import TranscriptionUi from "@/components/player/TranscriptionUi.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {TranscriptionUi},
|
components: {TranscriptionUi},
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TranscriptionLine from "./TranscriptionLine.vue";
|
import TranscriptionLine from "./TranscriptionLine.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -19,14 +19,14 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
trackElement() {
|
trackElement() {
|
||||||
this.setCues();
|
this.setCues()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cues: [],
|
cues: [],
|
||||||
trackElement: null
|
trackElement: null
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init()
|
this.init()
|
||||||
|
|
@ -45,7 +45,7 @@ export default {
|
||||||
this.cues = this.trackElement.track.cues
|
this.cues = this.trackElement.track.cues
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
#transcription-panel {
|
#transcription-panel {
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ export default class LocalAudioPlayer extends EventEmitter {
|
||||||
this.player.src = this.currentTrack.relativeContentUrl
|
this.player.src = this.currentTrack.relativeContentUrl
|
||||||
this.player.currentTime = this.startTime
|
this.player.currentTime = this.startTime
|
||||||
|
|
||||||
this.createTranscriptionTrack();
|
this.createTranscriptionTrack()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -211,23 +211,23 @@ export default class LocalAudioPlayer extends EventEmitter {
|
||||||
this.player.src = this.currentTrack.relativeContentUrl
|
this.player.src = this.currentTrack.relativeContentUrl
|
||||||
console.log(`[LocalPlayer] Loading track src ${this.currentTrack.relativeContentUrl}`)
|
console.log(`[LocalPlayer] Loading track src ${this.currentTrack.relativeContentUrl}`)
|
||||||
|
|
||||||
this.createTranscriptionTrack();
|
this.createTranscriptionTrack()
|
||||||
|
|
||||||
this.player.load()
|
this.player.load()
|
||||||
}
|
}
|
||||||
|
|
||||||
createTranscriptionTrack() {
|
createTranscriptionTrack() {
|
||||||
if (document.getElementById('transcription-track')) {
|
if (document.getElementById('transcription-track')) {
|
||||||
document.getElementById('transcription-track').remove();
|
document.getElementById('transcription-track').remove()
|
||||||
}
|
}
|
||||||
const trackElement = document.createElement("track");
|
const trackElement = document.createElement("track")
|
||||||
|
|
||||||
trackElement.id = "transcription-track";
|
trackElement.id = "transcription-track"
|
||||||
trackElement.kind = "subtitles";
|
trackElement.kind = "subtitles"
|
||||||
trackElement.label = "Transcription";
|
trackElement.label = "Transcription"
|
||||||
trackElement.default = true;
|
trackElement.default = true
|
||||||
trackElement.src = this.currentTrack.relativeTranscriptionUrl;
|
trackElement.src = this.currentTrack.relativeTranscriptionUrl
|
||||||
this.player.appendChild(trackElement);
|
this.player.appendChild(trackElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
destroyHlsInstance() {
|
destroyHlsInstance() {
|
||||||
|
|
|
||||||
|
|
@ -649,9 +649,9 @@ class LibraryItemController {
|
||||||
async getTranscriptionFile(req, res) {
|
async getTranscriptionFile(req, res) {
|
||||||
const libraryFile = req.libraryFile
|
const libraryFile = req.libraryFile
|
||||||
|
|
||||||
const baseName = Path.basename(libraryFile.metadata.path, Path.extname(libraryFile.metadata.path));
|
const baseName = Path.basename(libraryFile.metadata.path, Path.extname(libraryFile.metadata.path))
|
||||||
|
|
||||||
const vttFilePath = Path.join(Path.dirname(libraryFile.metadata.path), `${baseName}.vtt`);
|
const vttFilePath = Path.join(Path.dirname(libraryFile.metadata.path), `${baseName}.vtt`)
|
||||||
|
|
||||||
if (global.XAccel) {
|
if (global.XAccel) {
|
||||||
const encodedURI = encodeUriPath(global.XAccel + vttFilePath)
|
const encodedURI = encodeUriPath(global.XAccel + vttFilePath)
|
||||||
|
|
@ -660,9 +660,9 @@ class LibraryItemController {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the correct mimetype for .vtt files
|
// Set the correct mimetype for .vtt files
|
||||||
res.setHeader('Content-Type', 'text/vtt');
|
res.setHeader('Content-Type', 'text/vtt')
|
||||||
|
|
||||||
res.sendFile(vttFilePath);
|
res.sendFile(vttFilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue