Hi All,
I am trying to stream video which in located on the server somewhere. In Iphone every thing is allright but on IPod touch
App is crashed when pressing the "Done" button in the middle of streaming.
Here is my code :
videoImage.addEventListener('click', function
{
videoId = '/'+videoId;
videoURL1 = 'http://www.someurl.com/'+videoId;
var file1 = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,videoId);
var activeMovie;
if(file1.exists())
{
activeMovie = Ti.Media.createVideoPlayer({
url: videoURL,
movieControlMode:Ti.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
});
}
else
{
activeMovie = Ti.Media.createVideoPlayer({
url: videoURL1,
movieControlMode:Ti.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
});
}
win.add(activeMovie);
win.orientationModes =[Ti.UI.LANDSCAPE_RIGHT];//[Ti.UI.PORTRAIT];// ;
activeMovie.fullscreen = true;
try {
activeMovie.play();
} catch (err) {
Ti.API.log('error ' + err);
}
activeMovie.addEventListener('fullscreen', function(e){
if (!e.entering){
win.remove(activeMovie);
win.orientationModes = [Ti.UI.PORTRAIT];
activeMovie.stop();
activeMovie.release();
win.close();
}
});
});
Thanks in advance.
↧