Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move fetchData() from template to methods
(Templates are not made to call methods.)

Signed-off-by: Frederic Ruget <[email protected]>
  • Loading branch information
douzebis authored and CarlSchwan committed Sep 1, 2022
commit c89e6b349aeebcd7b4c9ec43848f9f65e49e7a8d
10 changes: 5 additions & 5 deletions src/components/Videos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
@canplay="doneLoading"
@loadedmetadata="onLoadedMetadata">

{{ fetchTracks() }}

<track v-for="track in tracks"
:key="track"
:src="track.src"
Expand Down Expand Up @@ -81,11 +79,11 @@ Vue.use(VuePlyr)
export default {
name: 'Videos',

data: () => ({
data() {
// This is required so that tracks is declared and reactive
// Otherwise updates may fail to make it to plyr
tracks: [],
}),
return { tracks: [], }
},

computed: {
livePhoto() {
Expand Down Expand Up @@ -165,6 +163,8 @@ export default {
},

onLoadedMetadata() {

this.fetchTracks()
this.updateVideoSize()
// Force any further loading once we have the metadata
if (!this.active) {
Expand Down