PDA

View Full Version : android flicker/freeze on data view



montana
7 Jun 2011, 9:41 PM
device: Acer Iconia Tab A500 3.01 android


we have a row of thumbnails loading across the top of the layout using a data view (swipe left and right) and each click of the thumbnail triggers a video. The action works perfectly on the ipad yet flickers on the above Android device and also freezes occasionally after the Android device goes to sleep.

Not sure if this is related to the Android animation "flicker" bug posted http://www.sencha.com/forum/showthread.php?135798-List-of-Known-Android-Issues-Fixed-in-Upcoming-Release but thought I'd post to see if there is a solution.

Here is our code

Ext.ns('Jtb');
Ext.regModel('VideoStoreModel', {
fields: ['thumb', 'subtitle','sources','title']
});
var videosArray=new Array();
var playVideoNumber=0;
Jtb.VideoHomeScreen = Ext.extend(Ext.Panel, {

layout:{type:'vbox',align:'stretch'},
scope:this,

//override
initComponent: function() {
this.fullscreen = true;
var obj=this;
this.VideoStore=new Ext.data.Store({
autoLoad:true,
model: "VideoStoreModel",
proxy: {
type: 'ajax',
url : 'controller/audio_video.php?action_a=getVideo',
reader: {
type: 'json',
root: 'data'
}
},
scope:this,
listeners:{
load : function(store,records,successful)
{
//play first video

}
}
});

//this.VideoMenuPanel is to show the video image in the top
//this.VideoContentPanel is to show the video player..

this.items = [

this.VideoMenuPanel=new Ext.DataView({
scroll:'horizontal',
height:125,
style:'background:gray;',
id:'videoDataView',
store:this.VideoStore,
tpl:new Ext.XTemplate(

'<tpl for=".">',
'<div class="thumb-video-wrap"><img src="http://www.mysite/Videos/{thumb}"><br/><span>&nbsp;</span></div>',

'</tpl>'),
itemSelector:'div.thumb-video-wrap',
emptyText: 'No images to display',
selectedItemCls:'playCss',
listeners:{
itemtap : function(dv,index,item,e )
{
//play selected video..
}
}
}),
this.VideoContentPanel=new Ext.Panel({
flex:1,
html:''
})
];


Jtb.VideoHomeScreen.superclass.initComponent.call(this);
this.on("activate",this.onActivate);
this.on("deactivate",this.onDeactivate);
},
onActivate:function()
{//when video page is active,replay the video last played
var video=document.getElementById("example_video_1");
if(video)
{
if(video.paused)
{
//video.currentTime = 0;
video.load();
video.play();
}
}
else{

}
},
onDeactivate:function()
{//when video page is deactivate,pause the video playing..

var video=document.getElementById("example_video_1");
//if(!video.paused)
video.pause();
}
});