diff options
| author | shpuld <shp@cock.li> | 2019-01-20 12:46:11 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-20 12:46:11 +0200 |
| commit | 485a061287149fe0ff5c4a188d21d775ff271f6d (patch) | |
| tree | 77802e1de9ef0688041d287585985fce06005af4 /src/components/media_modal/media_modal.js | |
| parent | e1c3691a72551926a292ed11d8fb0c723ead1552 (diff) | |
Polish for videos, smaller sizes, remove gif-looping options
Diffstat (limited to 'src/components/media_modal/media_modal.js')
| -rw-r--r-- | src/components/media_modal/media_modal.js | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index 95c3b4a9..7f10589c 100644 --- a/src/components/media_modal/media_modal.js +++ b/src/components/media_modal/media_modal.js @@ -2,11 +2,6 @@ import StillImage from '../still-image/still-image.vue' import fileTypeService from '../../services/file_type/file_type.service.js' const MediaModal = { - data () { - return { - loopVideo: this.$store.state.config.loopVideo - } - }, components: { StillImage }, @@ -22,6 +17,9 @@ const MediaModal = { }, type () { return this.currentMedia ? fileTypeService.fileType(this.currentMedia.mimetype) : null + }, + loopVideo () { + return this.$store.state.config.loopVideo } }, created () { @@ -34,26 +32,6 @@ const MediaModal = { methods: { hide () { this.$store.dispatch('closeMediaViewer') - }, - onVideoDataLoad (e) { - if (!e.srcElement) { - return - } - if (typeof e.srcElement.webkitAudioDecodedByteCount !== 'undefined') { - // non-zero if video has audio track - if (e.srcElement.webkitAudioDecodedByteCount > 0) { - this.loopVideo = this.$store.state.config.loopVideo && !this.$store.state.config.loopVideoSilentOnly - } - } else if (typeof e.srcElement.mozHasAudio !== 'undefined') { - // true if video has audio track - if (e.srcElement.mozHasAudio) { - this.loopVideo = this.$store.state.config.loopVideo && !this.$store.state.config.loopVideoSilentOnly - } - } else if (typeof e.srcElement.audioTracks !== 'undefined') { - if (e.srcElement.audioTracks.length > 0) { - this.loopVideo = this.$store.state.config.loopVideo && !this.$store.state.config.loopVideoSilentOnly - } - } } } } |
