From fc72bf0e97d7d4bca279adf020a37259f0e6d86a Mon Sep 17 00:00:00 2001 From: Preston Date: Thu, 24 Sep 2020 08:49:06 -0400 Subject: [PATCH] Revert keyboard shortcut change and test new method for consistent captions --- package.json | 1 - .../ft-video-player/ft-video-player.js | 17 +++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index ca67ee25..8256cfd9 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "lodash.uniqwith": "^4.5.0", "markdown": "^0.5.0", "material-design-icons": "^3.0.1", - "mediaelement": "^4.2.16", "nedb": "^1.8.0", "opml-to-json": "0.0.3", "rss-parser": "^3.9.0", diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index c9afc97a..23b7b149 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -2,15 +2,11 @@ import Vue from 'vue' import FtCard from '../ft-card/ft-card.vue' import $ from 'jquery' - -// I haven't decided which video player I want to use -// Need to expirement with both of them to see which one will work best. import videojs from 'video.js' import qualitySelector from '@silvermine/videojs-quality-selector' import 'videojs-vtt-thumbnails-freetube' import 'videojs-contrib-quality-levels' import 'videojs-http-source-selector' -// import mediaelement from 'mediaelement' export default Vue.extend({ name: 'FtVideoPlayer', @@ -226,11 +222,7 @@ export default Vue.extend({ qualitySelector(videojs, { showQualitySelectionLabelInControlBar: true }) } - this.player = videojs(videoPlayer, { - userActions: { - hotkeys: this.keyboardShortcutHandler - } - }) + this.player = videojs(videoPlayer) this.player.volume(this.volume) this.player.playbackRate(this.defaultPlayback) @@ -255,7 +247,7 @@ export default Vue.extend({ }, 200) } - // $(document).on('keydown', this.keyboardShortcutHandler) + $(document).on('keydown', this.keyboardShortcutHandler) this.player.on('mousemove', this.hideMouseTimeout) this.player.on('mouseleave', this.removeMouseTimeout) @@ -265,6 +257,11 @@ export default Vue.extend({ this.player.on('ready', function () { v.$emit('ready') + if (this.captionList.length > 0) { + this.player.caption({ + data: this.captionList + }) + } }) this.player.on('ended', function () {