jyotidhote
2 May 2011, 6:20 AM
Hi,
I am new to sencha and creating a app for playing video by selecting the thumbnail from tabpanel, i want that when application launch it will play the first video automatically and other video also get play automatically when selecting on thumbnail, its working fine on my desktop but not in iphone :((.. i need to tap for video play in iphone ....
Code :
Jtb.HomeScreen = Ext.extend( Jtb.TabPanelEasyScroll, {
data : [
{
url : 'video/Why_is_it_w.mp4',
img : 'http://www.jitterbug.tv/Videos/ak4ZyJfwpK.jpg',
artist : 'The Baby Grands',
song : 'What is it W?'
}, {
url : 'video/TheNumberSong.mp4',
img : 'http://www.jitterbug.tv/Videos/TsNwQ8OG0W.jpg',
artist : 'mr. Ray',
song : 'The Number Song'
}, {
url : 'video/supersonicrocket.mp4',
img : 'http://www.jitterbug.tv/Videos/7_paKnVr6T.jpg',
artist : 'The Bazillions',
song : 'Super Sonic Rocket Bike'
}, {
url : 'http://jitter.s3.amazonaws.com/Monsters.mp4',
img : 'http://www.jitterbug.tv/Videos/YNPfjbBdtF.jpg',
artist : 'Playgrounds',
song : 'Monsters'
}
],
initComponent: function() {
this.fullscreen = true;
this.defaults = {
xtype : 'video'
//autoResume :true
//setLoading:true
};
this.tabBar = {
cls : 'jtb_preivewbar',
scroll : {
direction : 'horizontal',
useIndicators: false
}
};
this.items = this.data;
this.dockedItems = [
this.titleBar = new Jtb.TitleBar({
dock : 'bottom'
})
];
this.on('afterrender', this.onAfterRenderPanel, this);
this.on('cardswitch', this.onCardSwitchPanel, this);
Jtb.HomeScreen.superclass.initComponent.call(this);
},
onAdd: function(cmp, idx) {
var tabBar = this.tabBar;
cmp.tab = tabBar.insert(idx, {
xtype: 'previewtab',
card: cmp
});
tabBar.doLayout();
},
//listener
onAfterRenderPanel: function() {
var activeCard = this.getActiveItem();
this.titleBar.updateTitle(activeCard.artist, activeCard.song);
activeCard.play();
onCardSwitchPanel: function(panel, newCard, oldCard, index, animated) {
this.titleBar.updateTitle(newCard.artist, newCard.song);
newCard.play();
}
});
Thanks for the help
I am new to sencha and creating a app for playing video by selecting the thumbnail from tabpanel, i want that when application launch it will play the first video automatically and other video also get play automatically when selecting on thumbnail, its working fine on my desktop but not in iphone :((.. i need to tap for video play in iphone ....
Code :
Jtb.HomeScreen = Ext.extend( Jtb.TabPanelEasyScroll, {
data : [
{
url : 'video/Why_is_it_w.mp4',
img : 'http://www.jitterbug.tv/Videos/ak4ZyJfwpK.jpg',
artist : 'The Baby Grands',
song : 'What is it W?'
}, {
url : 'video/TheNumberSong.mp4',
img : 'http://www.jitterbug.tv/Videos/TsNwQ8OG0W.jpg',
artist : 'mr. Ray',
song : 'The Number Song'
}, {
url : 'video/supersonicrocket.mp4',
img : 'http://www.jitterbug.tv/Videos/7_paKnVr6T.jpg',
artist : 'The Bazillions',
song : 'Super Sonic Rocket Bike'
}, {
url : 'http://jitter.s3.amazonaws.com/Monsters.mp4',
img : 'http://www.jitterbug.tv/Videos/YNPfjbBdtF.jpg',
artist : 'Playgrounds',
song : 'Monsters'
}
],
initComponent: function() {
this.fullscreen = true;
this.defaults = {
xtype : 'video'
//autoResume :true
//setLoading:true
};
this.tabBar = {
cls : 'jtb_preivewbar',
scroll : {
direction : 'horizontal',
useIndicators: false
}
};
this.items = this.data;
this.dockedItems = [
this.titleBar = new Jtb.TitleBar({
dock : 'bottom'
})
];
this.on('afterrender', this.onAfterRenderPanel, this);
this.on('cardswitch', this.onCardSwitchPanel, this);
Jtb.HomeScreen.superclass.initComponent.call(this);
},
onAdd: function(cmp, idx) {
var tabBar = this.tabBar;
cmp.tab = tabBar.insert(idx, {
xtype: 'previewtab',
card: cmp
});
tabBar.doLayout();
},
//listener
onAfterRenderPanel: function() {
var activeCard = this.getActiveItem();
this.titleBar.updateTitle(activeCard.artist, activeCard.song);
activeCard.play();
onCardSwitchPanel: function(panel, newCard, oldCard, index, animated) {
this.titleBar.updateTitle(newCard.artist, newCard.song);
newCard.play();
}
});
Thanks for the help