SplitmediaLabsLimited / xjs

XSplit JS Framework. Make plugins for XSplit Broadcaster, quickly and easily.
Other
39 stars 11 forks source link

Bug: isVideo returns false on looping videos #324

Open BrendaH opened 3 years ago

BrendaH commented 3 years ago

In a plugin I am building I want to get all video items from a presentation. To strip out anything not-video I do a check with isVideo. However, this returns false for a single looping video. After some digging I suspect that the problem is the asterisk notation behind the extension of a looping video (found in the FilePlaylist property). This problem consists of 2 parts:

Part 1: getValue returns the file path including the asterisk notation for looping (*0*2 for example). (When I printed the value that getValuereturned I also got *0*[times already looped] back). It seems that setValue was fixed for #295/#296 but getValue was not?

Part 2: isVideo looks at the prop:srcitem (the same thing that getValue returns) and when this includes the asterisk info the regex to check if it is a video fails. Because the regex does not allow anything after the extension.

The fix would therefore probably be to have getValue not return the asterisk-part, and let isVideo() use getValue(). A workaround for me now is to add [\*,\d]* before the dollar sign of the regex.