Skip to content

Commit

Permalink
feat: auto-repeat livephotos
Browse files Browse the repository at this point in the history
  • Loading branch information
jovanbulck committed Nov 8, 2024
1 parent 2a06c3e commit 416bc9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/frame/Photo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export default defineComponent({
try {
this.liveState.requested = true;
video.currentTime = 0;
video.loop = true;
await video.play();
} catch (e) {
// ignore, pause was probably called too soon
Expand Down
6 changes: 6 additions & 0 deletions src/components/viewer/PsLivePhoto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class LivePhotoContentSetup {
const video = content.element?.querySelector('video');
if (!video) return;

if (this.liveState.playing) {
video.pause();
return;
}

try {
this.liveState.waiting = true;
video.currentTime = 0;
Expand All @@ -57,6 +62,7 @@ class LivePhotoContentSetup {
video.playsInline = true;
video.disableRemotePlayback = true;
video.autoplay = false;
video.loop = true;
video.src = utils.getLivePhotoVideoUrl(photo, true);

const div = document.createElement('div');
Expand Down

0 comments on commit 416bc9d

Please sign in to comment.