Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1038] video crash after 3 plays

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:55:01.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:42:06.000+0000
Updated2011-04-17T01:55:01.000+0000

Description

app has multiple images. click image to play video. after 2-3 clicks - app crashes. code:


var win = Titanium.UI.createWindow();

var scrollView = Titanium.UI.createScrollView({
    contentWidth:320,
    contentHeight:'auto',
    top:0,
    showVerticalScrollIndicator:true,
    showHorizontalScrollIndicator:false
    });
    
var actInd = Titanium.UI.createActivityIndicator({
    bottom:10, 
    height:50,
    width:10,
    style:Titanium.UI.iPhone.ActivityIndicatorStyle.BIG
});

var xhr = Ti.Network.createHTTPClient();

xhr.open("GET","http://www.jimmyjohansson.net/rss/workIphoneRSS.xml");

xhr.onerror = function()
{
actInd.hide();  

alert("Error: Please check you're data connection and restart the app.");
};

actInd.show();

xhr.onload = function()
{
    try
    {
        var doc = this.responseXML.documentElement;
        var items = doc.getElementsByTagName("item");
        for (var c=0;c<items.length;c++){
            var item = items.item(c);           
            var link = item.getElementsByTagName("link").item(0).text;
            var image = item.getElementsByTagName("image").item(0).text;
            var imageView = Titanium.UI.createImageView({
                url:image,
                id:link,
                defaultImage:'images/loading-small.png',
                top:127*c,
                width:320,
                height:127
            });
            
            scrollView.add(imageView);                                          
        }
        win.add(scrollView);
            
        actInd.hide();
    }
    catch(E){
        alert(E);
    }
};

xhr.send();

win.add(actInd);

scrollView.addEventListener('click',function(e){
    var source = e.source;
    var activeMovie = Titanium.Media.createVideoPlayer({
        backgroundColor:'#000',
        url:source.id,
        movieControlMode:Titanium.Media.VIDEO_CONTROL_FULLSCREEN,
        scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
    });
    activeMovie.play();
});

win.open();

Comments

  1. Stephen Tramer 2011-04-15

    I think this issue was fixed by #894 but can't confirm because there appears to be a problem with playing remote video. Working on it now.

  2. Stephen Tramer 2011-04-15

    Yeah, fixed by #894. But see #1044.

JSON Source