Skip to content

Commit

Permalink
Merge pull request #324 from h3poteto/iss-323
Browse files Browse the repository at this point in the history
closes #323 Show image as a picture if the extension is unknown in Media
  • Loading branch information
Masaya Nasu authored May 21, 2018
2 parents adf6c83 + 9b5e92b commit 8ba46ce
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/renderer/components/TimelineSpace/Modals/Media.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<img :src="src" v-if="isImageFile()">
<video :src="src" v-else-if="isMovieFile()" controls></video>
<video :src="src" v-if="isMovieFile()" controls></video>
<img :src="src" v-else>
</template>

<script>
Expand All @@ -12,9 +12,6 @@ export default {
file_ext () {
return this.src.split('.').pop().toLowerCase()
},
isImageFile () {
return ['jpg', 'gif', 'png'].indexOf(this.file_ext()) >= 0
},
isMovieFile () {
return ['mp4'].indexOf(this.file_ext()) >= 0
}
Expand Down

0 comments on commit 8ba46ce

Please sign in to comment.