You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.The text was updated successfully, but these errors were encountered: