mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Initial transcription support
This commit is contained in:
parent
410801347c
commit
b37a863c0a
10 changed files with 227 additions and 63 deletions
29
client/components/player/TranscriptionLine.vue
Normal file
29
client/components/player/TranscriptionLine.vue
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<div :class="{ 'text-warning': isActive }">
|
||||
<div v-html="cue.text"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
cue: VTTCue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isActive: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.cue.onenter = () => (this.isActive = true);
|
||||
this.cue.onexit = () => (this.isActive = false);
|
||||
},
|
||||
watch: {
|
||||
isActive(newVal) {
|
||||
if (newVal) {
|
||||
this.$el.scrollIntoView({behavior: 'smooth'});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue