Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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

— asked November 22nd 2010 by aloha stitch
  • android
0 Comments

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

    — answered November 22nd 2010 by Aaron Saunders
    permalink
    0 Comments
  • So, have you any other solution to play video?

    — answered November 22nd 2010 by aloha stitch
    permalink
    0 Comments
  • 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.

    — answered November 23rd 2010 by aloha stitch
    permalink
    1 Comment
    • can you select the answer so others will know the question has been resolved

      — commented November 23rd 2010 by Aaron Saunders
  • 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.

    — answered March 23rd 2011 by Matt Collinge
    permalink
    0 Comments
  • 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/

    — answered November 22nd 2010 by Aaron Saunders
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.