VideoController

Plugins VideoController

The trigger Play does not seems to be working for me. Did anyone encounter similar problem?

Yes, that trigger does not do what you would think. I noticed that as well, so I looked at the source code again and it only resumes playback if the video(s) have been paused before. So completely different from the play button in the plugin interface, which basically resets everything and starts playback.

So I changed a few things again, because I had needed a proper "play" trigger for some basic UIButton video playback controls as well, and your comment reminded me to finally see what was up with that trigger.

Again I hope this is alright @VamSander
I am definitely entering forking territory here, which is what I am probably going to do unless @VamSander comes alive again in the near future.

So here is a version that has the aspect ratio hack from above and also modified triggers:
  • PlayNext: this does the same thing as the Play button in the interface, which I think always plays the next item(s)
  • PlayPause: plays/pauses the videos
  • Stop: actually stops the videos
 

Attachments

  • VideoController-aspectratiohack-playtriggers.cs
    41.6 KB · Views: 0
Yes, that trigger does not do what you would think. I noticed that as well, so I looked at the source code again and it only resumes playback if the video(s) have been paused before. So completely different from the play button in the plugin interface, which basically resets everything and starts playback.

So I changed a few things again, because I had needed a proper "play" trigger for some basic UIButton video playback controls as well, and your comment reminded me to finally see what was up with that trigger.

Again I hope this is alright @VamSander
I am definitely entering forking territory here, which is what I am probably going to do unless @VamSander comes alive again in the near future.

So here is a version that has the aspect ratio hack from above and also modified triggers:
  • PlayNext: this does the same thing as the Play button in the interface, which I think always plays the next item(s)
  • PlayPause: plays/pauses the videos
  • Stop: actually stops the videos

please add this to an official release!
 
Yes, that trigger does not do what you would think. I noticed that as well, so I looked at the source code again and it only resumes playback if the video(s) have been paused before. So completely different from the play button in the plugin interface, which basically resets everything and starts playback.

So I changed a few things again, because I had needed a proper "play" trigger for some basic UIButton video playback controls as well, and your comment reminded me to finally see what was up with that trigger.

Again I hope this is alright @VamSander
I am definitely entering forking territory here, which is what I am probably going to do unless @VamSander comes alive again in the near future.

So here is a version that has the aspect ratio hack from above and also modified triggers:
  • PlayNext: this does the same thing as the Play button in the interface, which I think always plays the next item(s)
  • PlayPause: plays/pauses the videos
  • Stop: actually stops the videos

Thank you so much for this! Just being able to add a UIButton to press to go to the next video is huge.

Now for a totally different issue... Why does the audio always stutter for me in VR? I tend to run my settings really high because I'm okay with things getting as low as around 18fps and I do have vsync active. Could that be the issue? It's weird though, because I get really solid video performance, but the audio is pretty consistently choppy. It gets worse when I add more screens, but it happens even with only one.
 
i found a solution to advancing to another video, create a button and have give it two actions, set screen to zero, then set screen to one. It will play another video, might not be in any order, but it does work for me well enough to be happy with it
 
i found a solution to advancing to another video, create a button and have give it two actions, set screen to zero, then set screen to one. It will play another video, might not be in any order, but it does work for me well enough to be happy with it


Thank you -- this really helped!

I was about to try the modified script above, but I'm glad to have a solution for this problem that can work with a clean hub hosted set of dependencies.

Now, for the next puzzle, I'm trying to make changing file lists work. Just sending a video path directive didn't seem to work, nor did following it up with a refresh/clear command, start then stop, or the above decrease/increase screens solution.

Anyone else have an approach that might work here?
 
So I decided to just take @Eye9's modifications above and tweak them a bit further to solve my own problem.

Basically, I made the Refresh/Clear trigger (and the Refresh button in the custom UI) do what I expected and clear the existing play queue for associated players.

With this change, you can set up a button to do the following sequence of actions to build "channel changing" interfaces:

VideoPath
RefreshClear
PlayNext (thanks to @Eye9's earlier tweaks!)

Additionally, I noticed that @Eye9's work with aspect ratios did indeed create issues with some of the grid modes, so I've fixed those as well.

Since @VamSander seems to no longer be around, I'll probably actually repost this as a new resource before too long, because I also want to post up some presets/subscenes to help folks make quick and better use of this script, as well as potentially some more fully featured scenes (or mods of others) using the latest version here. However, I want to wait a few days in case @Eye9 or @VamSander would like to grab my update and post it themselves, since I really only did a tiny bit of tweaking on top of their existing work.
 

Attachments

  • VideoController-refreshtrigger-aspectgrid.cs
    42.6 KB · Views: 0
Okay, I've posted the combination of Eye9 and my tweaks from above (along with a few other fixes and new triggers) as a new resource here:


Once again, though, @VamSander, if you return and would like to take the project back over, please just let me know. Thanks!
 
Works great, this is awesome. I can't get URL's to play. What would I be doing wrong? With a trigger i paste the URL in the play screen but it errors saying not a valid path or something.
 
Yeah I'm getting a white screen with the error "Attempted to use GetFilesAtPath on a path that is not inside game directory. That is not allowed"

Is there a solution to this? I've got videos stored in AddonPackages, Saves, Saves->Scripts, Saves->scene and a custom folder called Saves->scene->movie, but it doesn't matter whether I load from the default folder or a different one, I'm still getting that white screen.

There is also this error:
Exception caught: System.NullReferenceException: Object reference not set to an instance of an object
at IEnumerableExtension.ToList[String] (IEnumerable`1 collection) [0x00000] in <filename unknown>:0
at VamSander.VideoController.ReadFilesAtPath (System.String path) [0x00000] in <filename unknown>:0
at VamSander.VideoController.Update () [0x00000] in <filename unknown>:0 "
Not sure if that helps.
 
how to pause video? please
how to pause video.jpg
 
Last edited:
when I press play nothing happens it is not playing the videos no errors or anything, the mp4 files that i wanted to play are in that folder that I picked
 
For those that had challenges with this, I posted a Video Player that has everything setup for you with notes on using it....
 
I've created a new version of this plugin with some improvements, located here:
 
Back
Top Bottom