Hello Community,
I have developed six months ago, Titanium 1.8.2 on a video app. Now I wanted to change this Titanium 2.1.1. Unfortunately, I have the problem that the change of the videos with setUrl not work anymore. I have no idea what's wrong.
My system: Mountain Lion 08.10 XCode 4.4 SDK 2.1.1
My code:
var win = Titanium.UI.createWindow(); if(e.rowData.id == "fmb25ssw") { var videobeginn = 3; var videoanzahl = 14; var videoplay = 1; Titanium.UI.currentWindow.hide(); Titanium.UI.currentWindow.hideNavBar(); } else { var videobeginn = e.rowData.id; var videoplay = 0; } var options = { contentURL: 'training/' + videobeginn + '.mp4', scalingMode: Titanium.Media.VIDEO_SCALING_ASPECT_FIT, autoplay:true, fullscreen:true }; var activeMovie = Titanium.Media.createVideoPlayer(options); var gone = 0; activeMovie.addEventListener('complete',function(e) { if(videoplay == 1) { if (videobeginn<videoanzahl && e.reason === Titanium.Media.VIDEO_FINISH_REASON_PLAYBACK_ENDED && gone == 0) { videobeginn++; activeMovie.setUrl('training/' + videobeginn + '.mp4'); gone = 1; } else { videoplay = 0; Titanium.UI.currentWindow.show(); Titanium.UI.currentWindow.showNavBar(); win.close(); } } });
1 Answer
Accepted Answer
Using the setMedia() method haven't had any problems with download files playing, nor with streamed m3u8 files on 2.1.1
Your Answer
Think you can help? Login to answer this question!