remote video on android
Hi,
I use the code in kitchenSink project, the following code:
var media_url = 'http://philestore1.phreadz.com/_users/30/02/86/06/kosso/2010/04/20/1271776967_mymovie.mov';
var activeMovie = Titanium.Media.createVideoPlayer({
contentURL:media_url,
backgroundColor:'#111',
movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
});
activeMovie.play();
win.addEventListener('close', function() {
alert("Window closed");
activeMovie.stop();
});
It shows error "Invalid progressive playback". I try on android device (v1.6) and same.
Anyone know this error? Please help me.
Thanks
5 Answers
-
the error is because the video cannot be played in the Android media player. this is a link to a sample file I found on the internet that works fine with the code you have posted
if you search the google android group, you will find a long discussion
http://www.pocketjourney.com/downloads/pj/video/famous.3gp
-
So, have you any other solution to play video?
-
Thanks your reply.
I converted media file and play success.
And I have issue when changing media file.
I have 2 window:
In window1.js, I create a table view list media files
…
tableView.addEventListener('click', function(e){
Ti.App.Properties.setString('mediaFile', arrayMediaFile[e.index]); var win = Ti.UI.createWindow({url: 'window2.js'}); win.open();
});
In window2.js, play selected media file
var win = Ti.UI.currentWindow;
contentURL = Ti.App.Properties.getString('mediaFile');
var activeMovie = Titanium.Media.createVideoPlayer({
contentURL: contentURL,
backgroundColor:'#111',
movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FIT
});activeMovie.play();
With first selected media file, playing success. But when going back first window and choose another media file, having error "TypeError: Cannot call method "stop" of undefined". But if I choose same media file before, it's OK.
I think that activeMovie has not stopped yet. So I use:
win.addEventListener('close', function(e){
activeMovie.stop();
});
It still appear that error.
Please help me.
-
Just ran into this issue. The weird thing is that the video plays on both the Android and iPhone simulators, but not on the actual Android handset.
-
if the video content in converted properly, it should work in the Android media player,the solution is to convert the content correctly
http://www.digitalwerks.org/2009/03/15/video-encoding-for-the-android-step-by-step/