Skip to content

Feature/target av duration#1113

Merged
demiankatz merged 4 commits intodevfrom
feature/target-av-duration
Oct 11, 2024
Merged

Feature/target av duration#1113
demiankatz merged 4 commits intodevfrom
feature/target-av-duration

Conversation

@edsilv
Copy link
Copy Markdown
Member

@edsilv edsilv commented Sep 24, 2024

Add a second param to set target for MediaElement in order to pause after a given duration.

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 24, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
universalviewer βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Oct 1, 2024 9:10am

@edsilv edsilv changed the base branch from main to dev September 24, 2024 14:13
@edsilv edsilv requested a review from demiankatz September 24, 2024 14:14
that.player.setCurrentTime(t);
that.player.play();
this.player.setCurrentTime(t);
this.player.play();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you also need to account for this.config.options.autoPlayOnSetTarget here, or is there a reason this case is different?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

have pushed a fix

Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @edsilv. I'm not in a position to actually test this hands-on, but it looks good to me in theory now at least. :-)

@LanieOkorodudu
Copy link
Copy Markdown
Collaborator

@edsilv @demiankatz I attempted to test this configuration on the Vercel app using the available Video and Audio elements. Based on my understanding, this setup should allow users to specify a playback duration (e.g., 20 seconds), after which the media should automatically pause. Could you provide a sample manifest or configuration that I can use to validate if this functionality is working as expected? Please let me know if my interpretation of the feature is incorrect.

@demiankatz
Copy link
Copy Markdown
Contributor

@LanieOkorodudu, I'm not really familiar with how the target functionality works in AV; I assume you can test this by putting something in the target box in the example page, but I'm not sure what syntax to use. Perhaps @stephenwf can suggest something if @edsilv is unavailable.

@edsilv
Copy link
Copy Markdown
Member Author

edsilv commented Oct 10, 2024

@LanieOkorodudu
Copy link
Copy Markdown
Collaborator

@LanieOkorodudu Here's the preview with an AV manifest loaded: https://universalviewer-git-feature-target-av-duration-bl-uv-team.vercel.app/#?xywh=&iiifManifestId=https%3A%2F%2Fbiiif-template-example-3kntb3jpl-mnemoscene.vercel.app%2Fvideo%2Findex.json

In the target field under the UV, try setting: https://biiif-template-example-3kntb3jpl-mnemoscene.vercel.app/video/index.json/canvas/0#t=2

Which should play through to the end starting from 2 seconds.

Then try setting:

https://biiif-template-example-3kntb3jpl-mnemoscene.vercel.app/video/index.json/canvas/0#t=2,4

Which should start playing at 2 seconds then stop at 4 seconds.

Thank you, @edsilv . I have tested the implementation, initially setting the start point at 2 seconds as suggested, and also evaluated the second proposed approach. Additionally, I verified the functionality with an audio file to ensure compatibility. I tested it using the following link: [https://biiif-template-example-3kntb3jpl-mnemoscene.vercel.app/audio/index.json](One Small Step for Man - Audio), and confirmed that it works as expected.

Thanks again, Eds. I’m confident that users will find this feature valuable.

@LanieOkorodudu
Copy link
Copy Markdown
Collaborator

@LanieOkorodudu, I'm not really familiar with how the target functionality works in AV; I assume you can test this by putting something in the target box in the example page, but I'm not sure what syntax to use. Perhaps @stephenwf can suggest something if @edsilv is unavailable.

@demiankatz Thanks Demian, I have tested the feature in video as suggested by Eds and additionally verified it with audio to ensure functionality across both formats. I can confirm that it works as expected.

@demiankatz
Copy link
Copy Markdown
Contributor

Thanks, everyone, I'll go ahead and merge this!

@demiankatz demiankatz merged commit 93e4ca4 into dev Oct 11, 2024
@demiankatz demiankatz deleted the feature/target-av-duration branch October 11, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants