mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-14 12:18:24 +00:00
add watch progress bar
This commit is contained in:
parent
cf24fd5208
commit
005a938261
@ -10,6 +10,7 @@
|
|||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
<div class="w-full">
|
||||||
<img
|
<img
|
||||||
class="w-full aspect-video"
|
class="w-full aspect-video"
|
||||||
:src="item.thumbnail"
|
:src="item.thumbnail"
|
||||||
@ -17,6 +18,16 @@
|
|||||||
:class="{ 'shorts-img': item.isShort }"
|
:class="{ 'shorts-img': item.isShort }"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
|
<!-- progress bar -->
|
||||||
|
<div class="relative w-full h-1">
|
||||||
|
<div
|
||||||
|
class="absolute bottom-0 left-0 h-1 bg-red-600"
|
||||||
|
v-if="item.watched && item.duration > 0"
|
||||||
|
:style="{ width: `clamp(0%, ${(item.currentTime / item.duration) * 100}%, 100%` }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="relative text-sm">
|
<div class="relative text-sm">
|
||||||
<span
|
<span
|
||||||
class="thumbnail-overlay thumbnail-right"
|
class="thumbnail-overlay thumbnail-right"
|
||||||
@ -148,6 +159,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.updateWatched([this.item]);
|
||||||
this.shouldShowVideo();
|
this.shouldShowVideo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -213,6 +213,7 @@ const mixin = {
|
|||||||
request.onsuccess = function (event) {
|
request.onsuccess = function (event) {
|
||||||
if (event.target.result) {
|
if (event.target.result) {
|
||||||
video.watched = true;
|
video.watched = true;
|
||||||
|
video.currentTime = event.target.result.currentTime;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user