I have a video object with a net stream attached to it I am targeting html5. Other elements resize properly when the browser window is resized except the net stream video the size stays in the original state. I am calling the resize function with an event listener:
stage.addEventListener (Event.RESIZE, function (e) {
resize();
});
public function resize(){
video.width = stage.stageWidth
}
When I trace the width of the video the size adjusts with the window but the video stream itself remains static. What am I missing?
Ok so it seems I found a workaround from another thread I ran it with -Dcanvas and that allows the video to be resized but the video gets choppy and does not play as smooth. So it appears to be an issue with webgl.
If the video.videoWidth/video.videoHeight changes then it does not resize the texture. Does/can the video width/height change in HTML5 while it is playing?
I meant in HTML5 is there a way to resize a video element?
If so then it might be possible to resize the underlying video object attached to the netstream and with a patch to the Context3D render code above allow the matching GL texture size to change with it
Not sure I understand the question. Are you asking id I have a method in my code to change the size? Or if HTML5 target in general allows this. To the second question I don’t know but plain javascript seems to allow this in other players not developed with OpenFL. Again I am not sure if this is what you are asking.
Starting to play a video exposes a videoWidth and a videoHeight property. In DOM mode we add this element directly to the stage, but in canvas and Context3D we have to draw this to a temporary surface. This should match the actual width and height of the video.
Scaling on canvas or 3D should apply to this intermediate surface as if you used a bitmap + BitmapData then scaled it
Oh - question, does it work when the movie is playing? Is the issue resizing while the video is paused?
So the resizing only works when using canvas in HTML5. Since it is working with that I just went with it instead of using the 3d acceleration.
@nanjizal
No it did not help. Your player code has the same issue as mine when resizing the video. When using 3d acceleration the video does not scale in a browser.