feat(recommends): Changed type of recommends in index.vue

This commit is contained in:
Georgiy 2023-05-03 15:10:09 +03:00
parent 0ddda59c72
commit 1b15c6236c
2 changed files with 6 additions and 3 deletions

View File

@ -380,7 +380,7 @@ export default {
required: true, required: true,
}, },
recommends: { recommends: {
type: Array, type: Object,
default: () => { default: () => {
return []; return [];
}, },
@ -416,6 +416,7 @@ export default {
mounted() { mounted() {
console.log("sources", this.sources); console.log("sources", this.sources);
console.log("recommends", this.recommends); console.log("recommends", this.recommends);
console.log("video", this.video);
this.vid = this.$refs.player; this.vid = this.$refs.player;
// TODO: this.$store.state.player.quality, check if exists and select the closest one // TODO: this.$store.state.player.quality, check if exists and select the closest one
@ -535,7 +536,7 @@ export default {
if (this.xhr) this.xhr.abort(); if (this.xhr) this.xhr.abort();
if (this.isFullscreen) this.exitFullscreen(); if (this.isFullscreen) this.exitFullscreen();
if (this.bufferingDetected) clearTimeout(this.bufferingDetected); if (this.bufferingDetected) clearTimeout(this.bufferingDetected);
screen.orientation.removeEventListener("change"); // screen.orientation.removeEventListener("change");
this.$refs.player.removeEventListener("loadeddata", this.loadedDataEvent); this.$refs.player.removeEventListener("loadeddata", this.loadedDataEvent);
this.$refs.player.removeEventListener("timeupdate", this.timeUpdateEvent); this.$refs.player.removeEventListener("timeupdate", this.timeUpdateEvent);
this.$refs.player.removeEventListener("progress", this.progressEvent); this.$refs.player.removeEventListener("progress", this.progressEvent);

View File

@ -68,7 +68,9 @@ export default {
.then((result) => { .then((result) => {
if (result) this.recommends = [result]; if (result) this.recommends = [result];
}) })
.catch(error => {}); .catch((error) => {
console.error(error);
});
} }
}, },
}; };