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

getPlaybackDuration only works for active scene #326

Open
BrendaH opened this issue Dec 7, 2020 · 1 comment
Open

getPlaybackDuration only works for active scene #326

BrendaH opened this issue Dec 7, 2020 · 1 comment
Labels
Milestone

Comments

@BrendaH
Copy link

BrendaH commented Dec 7, 2020

I needed to loop over all sources in my project and store the duration (if it was a video), but it turned out that getPlaybackDuration only works for media in the currently active scene. For media in other scenes it returns 0.

My workaround is to directly use
xjs.IO.getVideoDuration(await item.getValue()) / 1e7
to get the duration in seconds.

I think either getPlaybackDuration should just work for all media items that you use it on, or the documentation should list this limitation.

@SML-MeSo SML-MeSo added this to the 2.11.0 milestone Jan 20, 2021
@SML-MeSo
Copy link
Collaborator

I'm afraid that is indeed a limitation. Will check with the team on how to properly communicate this in the documentation as this is not the only method exhibiting that behavior. Almost all source-specific calls fail when called while the source is not loaded, i.e. when not in active AND not kept loaded in memory.

I guess this was overlooked since there was a time (1.x days I think), when all properties and method are not accessible if called when source is not kept loaded or not in the active scene. Until core changes were made to enable access to item-specific calls for unloaded items, that is.

@SML-MeSo SML-MeSo added the docs label Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants