mirror of
https://github.com/anatolykopyl/movieroom-front.git
synced 2026-03-26 21:05:21 +00:00
Request based on filename
This commit is contained in:
@@ -3,6 +3,7 @@ export interface Room {
|
|||||||
magnet: string;
|
magnet: string;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
movie?: string;
|
movie?: string;
|
||||||
|
filename?: string;
|
||||||
downloaded?: boolean;
|
downloaded?: boolean;
|
||||||
downloadedAt?: Date;
|
downloadedAt?: Date;
|
||||||
position: number;
|
position: number;
|
||||||
|
|||||||
@@ -12,12 +12,12 @@
|
|||||||
<video
|
<video
|
||||||
v-if="room.downloaded"
|
v-if="room.downloaded"
|
||||||
controls
|
controls
|
||||||
:src="movieUrl"
|
|
||||||
ref="video"
|
ref="video"
|
||||||
@seeked="seeked"
|
@seeked="seeked"
|
||||||
@play="playing = true"
|
@play="playing = true"
|
||||||
@pause="playing = false"
|
@pause="playing = false"
|
||||||
>
|
>
|
||||||
|
<source :src="movieUrl" type="video/mp4">
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -55,7 +55,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
movieUrl() {
|
movieUrl() {
|
||||||
return `${process.env.VUE_APP_MOVIES}?id=${this.room.id}`;
|
return `${process.env.VUE_APP_MOVIES}?filename=${this.room.filename}`;
|
||||||
},
|
},
|
||||||
progressPerc() {
|
progressPerc() {
|
||||||
return Math.floor(this.progress * 100);
|
return Math.floor(this.progress * 100);
|
||||||
@@ -68,7 +68,7 @@ export default defineComponent({
|
|||||||
this.progressInterval = setInterval(async () => {
|
this.progressInterval = setInterval(async () => {
|
||||||
const result = await getStatus(this.id);
|
const result = await getStatus(this.id);
|
||||||
this.progress = result.progress;
|
this.progress = result.progress;
|
||||||
if (result.downloaded) {
|
if (result.downloaded || this.progress === 1) {
|
||||||
this.room.downloaded = true;
|
this.room.downloaded = true;
|
||||||
clearInterval(this.progressInterval);
|
clearInterval(this.progressInterval);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user