From ac6259eb059a39e016f3329f2be98e90e6186375 Mon Sep 17 00:00:00 2001 From: Curt Grimes Date: Thu, 2 May 2019 23:59:24 -0500 Subject: [PATCH] SRT initial work --- app/assets/scss/app.scss | 2 + .../captioner/settings/general/index.vue | 44 +++- app/pages/srt.vue | 197 ++++++++++++++++++ app/store/captioner.js | 8 + 4 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 app/pages/srt.vue diff --git a/app/assets/scss/app.scss b/app/assets/scss/app.scss index 34a887d..22657c2 100644 --- a/app/assets/scss/app.scss +++ b/app/assets/scss/app.scss @@ -141,6 +141,8 @@ $modal-content-box-shadow-xs: $modal-content-box-shadow-sm-up; @import '~bootstrap/scss/_utilities.scss'; @import '~bootstrap/scss/_print.scss'; +@import 'bootstrap-vue/src/index.scss'; + .logo-text { font-family: $headings-font-family; text-transform: uppercase; diff --git a/app/pages/captioner/settings/general/index.vue b/app/pages/captioner/settings/general/index.vue index 9d534eb..0d6fe0e 100755 --- a/app/pages/captioner/settings/general/index.vue +++ b/app/pages/captioner/settings/general/index.vue @@ -46,6 +46,34 @@

+ +
+
+ +
+
+
+
More real-time captions
+
+ +
+
More real-time captions
+
+
+
+
+
+
@@ -223,11 +251,23 @@ diff --git a/app/store/captioner.js b/app/store/captioner.js index db8a83c..2246f44 100644 --- a/app/store/captioner.js +++ b/app/store/captioner.js @@ -32,6 +32,7 @@ export const state = () => ({ delay: 0, cursorable: [], stabilized: '', + stabilizedWithTimings: [], }, totalCaptioningSeconds: 0, lastStart: null, @@ -697,6 +698,8 @@ export const mutations = { }, CLEAR_TRANSCRIPT_FINAL(state) { state.transcript.final = ''; + state.transcript.stabilized = ''; + state.transcript.stabilizedWithTimings = []; }, CLEAR_TRANSCRIPT_TYPED(state) { state.transcript.typed = ''; @@ -717,6 +720,11 @@ export const mutations = { transcript }) { state.transcript.stabilized += transcript + ' '; + + state.transcript.stabilizedWithTimings.push({ + time: Date.now() - 2500, + text: transcript, + }); }, VOLUME_TOO_LOW(state, {