Jump to content

How to control the playing of video


mcsteeze
 Share

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...

 

 

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...