Sign in to follow this  
mcsteeze

How to control the playing of video

Recommended Posts

Hi, 

 

Am I correct that the only way to load in a video texture and have it render in the Pixi.js renderer is by using the VideoTexture.fromURL method?

var texture = PIXI.VideoTexture.fromUrl("test.mp4");

If this is correct, is there a way to have control to the native HTMLMediaElement controls? (i.e. restart the video, scroll in video, etc.)

 

Lastly, because this is webGL, I would assume that displaying video textures (playing clips) in pixi is faster than just using the native html5 video element and some library that manipulates it (like videojs)

 

Ultimately I would like to be able to make custom controls for the video player using Pixi sprites, does this sound workable? The main thing is I just do not know how to control the video once it is playing...

 

 

Share this post


Link to post
Share on other sites

 is there a way to have control to the native HTMLMediaElement controls? (i.e. restart the video, scroll in video, etc.)
 
"texture.baseTexture.source" is the video element, just like any other texture's source.
 
Lastly, because this is webGL, I would assume that displaying video textures (playing clips) in pixi is faster than just using the native html5 video element and some library that manipulates it (like videojs)

Nope, basically what is happening is the normal playing of the video, then each frame is captured uploaded to the gpu and rerendered through pixi. You are rendering each frame twice, so unless you are doing something with shaders or other pixi features you are basically just reducing performance for no reason.

>Ultimately I would like to be able to make custom controls for the video player using Pixi sprites, does this sound workable? The main thing is I just do not know how to control the video once it is playing...

You can, but see my above comment. If that is all you are doing with it you should just use a native video player directly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.