Skip to content

Commit

Permalink
Fix opening non-dav audio, gif and video
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
ChristophWurst authored and nextcloud-command committed Aug 25, 2022
1 parent 0a45152 commit 96b28c3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/Audios.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<template>
<!-- Plyr currently replaces the parent. Wrapping to prevent this
https://github.com/redxtech/vue-plyr/issues/259 -->
<div v-if="davPath">
<div v-if="src">
<VuePlyr ref="plyr"
:options="options">
<audio ref="audio"
:autoplay="active"
:src="davPath"
:src="src"
preload="metadata"
@ended="donePlaying"
@canplay="doneLoading">
Expand Down
9 changes: 8 additions & 1 deletion src/components/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<ImageEditor v-if="editing"
:mime="mime"
:src="davPath"
:src="src"
:filename="filename"
@close="onClose" />

Expand Down Expand Up @@ -77,6 +77,9 @@ export default {
},
computed: {
src() {
return this.source ?? this.davPath
},
zoomHeight() {
return Math.round(this.height * this.zoomRatio)
},
Expand All @@ -87,6 +90,10 @@ export default {
asyncComputed: {
data() {
if (this.source) {
return this.source
}
switch (this.mime) {
case 'image/svg+xml':
return this.getBase64FromImage()
Expand Down
4 changes: 2 additions & 2 deletions src/components/Videos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<!-- Plyr currently replaces the parent. Wrapping to prevent this
https://github.com/redxtech/vue-plyr/issues/259 -->
<div v-if="davPath">
<div v-if="src">
<VuePlyr ref="plyr"
:options="options"
:style="{
Expand All @@ -34,7 +34,7 @@
:autoplay="active ? true : null"
:playsinline="true"
:poster="livePhotoPath"
:src="davPath"
:src="src"
preload="metadata"
@ended="donePlaying"
@canplay="doneLoading"
Expand Down
3 changes: 3 additions & 0 deletions src/mixins/Mime.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export default {
ext() {
return parsePath(this.basename).ext
},
src() {
return this.source ?? this.davPath
},
},

watch: {
Expand Down
1 change: 0 additions & 1 deletion src/mixins/PreviewUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default {
basename: this.basename,
})
},

},
methods: {
/**
Expand Down

0 comments on commit 96b28c3

Please sign in to comment.