Remove semicolon

This commit is contained in:
mfcar 2024-05-04 20:31:39 +01:00
parent 35f51f4e98
commit bfcf4e317f
No known key found for this signature in database
4 changed files with 19 additions and 19 deletions

View file

@ -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},

View file

@ -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 {

View file

@ -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() {

View file

@ -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)
} }
/** /**