Constrain view with video
I am getting this error…[ERROR] Trying to constraint a view without a proxy's layout.
…when I hit the done button on my video.
The only thing I am doing when hitting done is this:
activeMovie.addEventListener('complete',function(e)
{
Ti.API.info(e);
});
Any ideas?
7 Answers
-
Also this is my video object
var activeMovie = Titanium.Media.createVideoPlayer({ contentURL: video, backgroundColor:'#000', fullscreen:true, movieControlMode:Titanium.Media.VIDEO_CONTROL_FULLSCREEN, scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL });
-
So this happens to nobody?
-
bump
-
I can't reproduce what you are seeing. What version of the mobile SDK are you using? Is there more to that code that just the movie? How are you attaching it to a view or window?
-
This is my full video.js file. I changed the video object a little bit. The error is still present, however, it actually closes the window now rather than just going black. I am using SDK 4.0
var win = Titanium.UI.currentWindow; var video = win.video; var activeMovie = Titanium.Media.createVideoPlayer({ contentURL: video, backgroundColor:'#000', fullscreen:true }); win.add(activeMovie); activeMovie.addEventListener('complete', function(e) { Ti.App.fireEvent("finishMovie"); win.orientationModes = [Titanium.UI.PORTRAIT]; }); activeMovie.addEventListener('fullscreen', function(e) { if (!e.entering) { activeMovie.stop(); win.orientationModes = [Titanium.UI.PORTRAIT]; } }); win.orientationModes = [ Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT, Titanium.UI.PORTRAIT ]; activeMovie.play();
-
I was getting this error when I added a window (win2) to an existing window (win1) and used an event to manipulate win2. The code below will duplicate the error. If you comment out the line that adds win2 to win1, the error disappears and everything works as it should. I am not a Titanium expert and I really don't understand why this happens, but this error appears to be related to how windows are rendered and ordered in the stack.
If I were to guess what the problem is in your code, I would say that either you are doing something in the finishMovie event that manipulates the activeMovie window or it has something to do with the fullscreen stuff. Try commenting out one of the lines in your 'complete' listener to narrow it down.
Titanium.UI.setBackgroundColor('#000'); var win1 = Titanium.UI.createWindow({ backgroundColor:'#000', width:320, height:380, bottom:0 }); win1.open(); var win2 = Titanium.UI.createWindow({ backgroundColor:'#fff', width:120, height:180, bottom:0 }); win1.add(win2); // this is the culprit; comment this out and everything works!!! win2.open(); var b1 = Titanium.UI.createButton({ title:'click me', height:40, width:200, top:50 }); win1.add(b1); var visible = true; b1.addEventListener('click', function() { if (!visible) { win2.open(); visible=true; } else { win2.close(); visible=false; } });
-
This is a bug in official 1.4.1.1 and 1.4.2. You have to use the version from http://builds.appcelerator.com.s3.amazonaws.com/index.html