Worked in previous SDKs, but now if you put a YouTube webview in a tableview row then click to start the video, then rotate the device the video stops & closes. This same behavior works fine if the webview is added directly to the window (like the KitchenSink).
_Included below for convenience_
Note: Must run on device to see YouTube
Ti.UI.setBackgroundColor('#000');
var testTableView = true;
var youTubeID = 'GJ98Oezr_l4';
var win = Ti.UI.createWindow({
title: 'Window',
backgroundColor: '#fff',
orientationModes: [Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]
});
if (Ti.Platform.model == 'Simulator') {
win.add(Ti.UI.createLabel({
text: 'Must run on device\nto see YouTube',
font: {
fontSize: 20,
fontFamily: 'Helvetica Neue'
},
textAlign: 'center',
width: 'auto'
}));
}
else {
var videoHtml = '<html><head><meta name="viewport" content="width=100, initial-scale=1.0, user-scalable=no"/></head><body style="margin:0;padding:0;">';
videoHtml += '<div><object width="100" height="70"><param name="movie" value="http://www.youtube.com/watch?v=' + youTubeID + '"></param>';
videoHtml += '<param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/watch?v=' + youTubeID + '" ';
videoHtml += '" type="application/x-shockwave-flash" wmode="transparent" width="100f" height="70f"></embed></object></div></body></html>';
var wvYoutube = Ti.UI.createWebView({
width: 100,
height: 70,
html: videoHtml,
scalesPageToFit: true
});
if (!testTableView) {
win.add(Ti.UI.createLabel({
text: 'Click to play,\nthen rotate device,\nit works!',
font: {
fontSize: 20,
fontFamily: 'Helvetica Neue'
},
top: 2,
height: 80,
textAlign: 'center',
width: 'auto'
}));
win.add(wvYoutube);
}
else {
var data = [];
var rowLabel = Ti.UI.createTableViewRow({
height: 105
});
rowLabel.add(Ti.UI.createLabel({
text: 'Click to play,\nthen rotate device,\nit stops and often\ndisappears!',
font: {
fontSize: 20,
fontFamily: 'Helvetica Neue'
},
top: 2,
height: 105,
textAlign: 'center',
width: 'auto'
}));
data.push(rowLabel);
var rowYoutube = Ti.UI.createTableViewRow({
height: 100,
className: 'VideoRow'
});
rowYoutube.add(wvYoutube);
data.push(rowYoutube);
var tvYoutube = Ti.UI.createTableView({
backgroundColor: 'white',
rowBackgroundColor: 'transparent',
separatorColor: '#e1e1e1',
data: data
});
win.add(tvYoutube);
}
}
win.open();
It looks like this has since been fixed, but I am unable to close it.
This issue has reappeared in the master branch. So it still needs fixing.
Unable to reproduce. Tested on 4.3.5, 5.0.1 iPhones with 1.7.5, 1.8.0, 1.8.0.1, 1.9.0 SDKs
Mike: Please let us know if this issue persists. Provide exact steps to reproduce this problem if you can reproduce it with the latest build.
We cannot reproduce this issue with the latest builds.
please re-open if you can reproduce.