Titanium Community Questions & Answer Archive

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

Streaming Video on Android

Has anyone had any luck getting streaming video to work on Android? The videos work if I store them locally in the app, but that really isn't an option due to the fact that the videos are going to be dynamically added from our website.

— asked November 10th 2010 by Sam McConnell
  • android
  • streaming
  • video
0 Comments

6 Answers

  • Hi, any luck with this? I am unable to stream a video. I've taken the remote video js from the kitchensink and I can hear the audio (stops every few seconds though), I can see no video. I can only try with the emulator so far.

    Any info?

    Thanks.

    — answered November 14th 2010 by GunsNRails GR
    permalink
    0 Comments
  • I would like to know if anyone has any luck with this. I am building an App that streams video from my site aswell (Stored in a MySQL Database) and I would like it for both iOS and Android. Right now (Because I find the Titanium Video Player sucks) I am creating a Web View and embedding the file using HTML, but I don't think Android likes that either.

    — answered November 15th 2010 by Colton Arabsky
    permalink
    0 Comments
  • No luck here either. Everything keeps giving me sound, but no video. I've had to just abandon the Android version of my app for the time being due to this bug. Hopefully 1.5 will have a fix for this.

    — answered November 15th 2010 by Sam McConnell
    permalink
    1 Comment
    • Android is particular in the formats it supports especially on emulator. There is another thread here in Q&A about video and what we had to do. You can also google for the device requirements.

      — commented November 15th 2010 by Don Thorp
  • got the same issue.
    got sound.
    haven't got picture.

    — answered November 19th 2010 by Klaus Ahrenst
    permalink
    0 Comments
  • 
    var win = Titanium.UI.currentWindow;
    var android = (Titanium.Platform.name == 'android');
    
    
    
    
    
    var activeMovie = Titanium.Media.createVideoPlayer({
        contentURL:'http://video.qa.knowledgeblue.com/Sales.mp4',
        backgroundColor:'#111',
        movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
        scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
    });
    
    if (parseFloat(Titanium.Platform.version) >= 3.2)
    {
        activeMovie.movieControlStyle = Titanium.Media.VIDEO_CONTROL_EMBEDDED;
    //  activeMovie.movieControlStyle = Titanium.Media.VIDEO_CONTROL_FULLSCREEN;
    //  activeMovie.movieControlStyle = Titanium.Media.VIDEO_CONTROL_NONE;
        if (Titanium.Platform.osname == "ipad") {
            activeMovie.width = 400;
            activeMovie.height = 300;
        }
        win.add(activeMovie);
    
    }
    
    // label 
    var movieLabel = Titanium.UI.createLabel({
        text:'Do not try this at home',
        width:'auto',
        height:35,
        color:'white',
        font:{fontSize:24,fontFamily:'Helvetica Neue'}
    });
    
    // add label to view
    //activeMovie.add(movieLabel);
    
    // label click
    movieLabel.addEventListener('click',function()
    {
        movieLabel.text = "You clicked the video label. Sweet!";
    });
    
    activeMovie.addEventListener('load',function()
    {
        // animate label
        var t = Titanium.UI.create2DMatrix();
        t = t.scale(3);
        movieLabel.animate({transform:t, duration:500, color:'red'},function()
        {
            var t = Titanium.UI.create2DMatrix();
            movieLabel.animate({transform:t, duration:500, color:'white'});
        });
    });
    activeMovie.addEventListener('complete',function()
    {
        var dlg = Titanium.UI.createAlertDialog({title:'Movie', message:'Completed!'});
        if (Ti.Platform.name == 'android') {
            dlg.addEventListener('click', function(e) {
                activeMovie.hide();     
                win.close();
            });
            dlg.show();
        } else {
            dlg.show();
            win.close();
        }
    });
    
    activeMovie.play();
    
    win.addEventListener('close', function() {
        activeMovie.stop();
    });
    
    — answered May 25th 2011 by Justin Mathew
    permalink
    0 Comments
  • Sorry for the multiple posts. I kept getting an error page when I submitted the question that said to try refreshing the page.

    — answered November 10th 2010 by Sam McConnell
    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.