Skip to content

Instantly share code, notes, and snippets.

@joshjensen
Created April 21, 2012 14:52
Show Gist options
  • Save joshjensen/2437514 to your computer and use it in GitHub Desktop.
Save joshjensen/2437514 to your computer and use it in GitHub Desktop.
Video pops out of full screen when played inside a table row and rotated.
// Video pops out of full screen when played inside a table row and rotated.
// Steps to replicate:
// 1. Wait for video to load.
// 2. Click to open full screen.
// 3. Rotate device.
// Video pops out of full screen mode.
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
orientationModes: [
Titanium.UI.PORTRAIT,
Titanium.UI.UPSIDE_PORTRAIT,
Titanium.UI.LANDSCAPE_LEFT,
Titanium.UI.LANDSCAPE_RIGHT
]
});
var tableView = Ti.UI.createTableView();
win.add(tableView);
var row = Ti.UI.createTableViewRow({
height: 'auto',
selectedBackgroundColor: '#fff'
});
var videoPlayer = Titanium.Media.createVideoPlayer({
url: 'http://vid.ly/3b1t5p',
top: 6,
autoplay : false,
backgroundColor : '#000',
height: 169,
width: 300,
allowsAirPlay: true,
mediaControlStyle:Titanium.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FIT
});
row.add(videoPlayer);
tableView.setData([row]);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment