Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): slideshow ascending order when video has ended #8024

Closed
wants to merge 5 commits into from

Conversation

martabal
Copy link
Member

When video has ended, the slideshow order is not respected. This PR fix it.

Copy link

cloudflare-workers-and-pages bot commented Mar 17, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: b96a07d
Status: ✅  Deploy successful!
Preview URL: https://a8da99fd.immich.pages.dev
Branch Preview URL: https://fix-slideshow-video.immich.pages.dev

View logs

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

web/src/lib/components/asset-viewer/video-viewer.svelte Outdated Show resolved Hide resolved

const handleCanPlay = async (event: Event) => {
try {
const video = event.currentTarget as HTMLVideoElement;
video.muted = true;
await video.play();
video.muted = false;
dispatch('onVideoStarted');
if (onVideoStart) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, does onVideoStart ?? onVideoStart() work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would want to do onVideoStart && onVideoStart() and that should work, yea

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really it should just be onVideoStart?.()

@martabal martabal force-pushed the fix/slideshow-video branch from 2f5d2ae to 1feb877 Compare March 17, 2024 22:25
Comment on lines 450 to 452
$slideshowNavigation === SlideshowNavigation.AscendingOrder
? await navigateAsset('previous')
: await navigateAsset('next');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, I really dislike this. We're adding more duplicate code everywhere and the asset-viewer is even more coupled to the slideshow functionality than it was before. The component should only be in charge of rendering an asset, not managing all this unrelated state.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved everything to navigateAsset

@martabal martabal force-pushed the fix/slideshow-video branch from 4436bd5 to b96a07d Compare March 18, 2024 20:01
@martabal martabal closed this Mar 21, 2024
@martabal martabal deleted the fix/slideshow-video branch March 21, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants