PDA

View Full Version : Video media event handling



sandeepmnit35
18 Jan 2013, 4:13 AM
I am using below view to play a video but in Iphone it is showing a black screen then after some seconds it is showing the black screen with play icon and then movind to iphone native video player to play the video. I want to skips the 2 blackscreen and want directly native player once I call below view. If it is not posible , I want to display a loading popup and hide it once it show native player but don't know how to hide that after staring it. What event I need to handle here.

once video is ended in the native video player it is firing ended event which I am hadnling but if I click on done button without completely play of video player, it is not firing stop event.Which event it will hire in this scenario so I can capture it.

Please help me in this.


Ext.define('Por.view.Videop', {
extend: 'Ext.Panel',
xtype:'videopage',

config:{
layout:'fit',
fullscreen: true,
items:[

{
xtype : "titlebar",
docked : "top",
name : 'detailToolbar',

items : [{
xtype: 'button',
ui : 'back',
text: 'Back',
align: 'left',
action : 'back'

}]
},
{
xtype : 'video',
id: 'videoplay',
loop: false,
enableControls: false,
preload: true,
autoPause: true,
url:'resources/media/a.mp4',
listeners: {



stop: {
element: 'media',
fn: function () {
alert("in stop");
//this.parent.fireEvent("stopmask");

}


},




ended: {
element: 'media',
fn: function () {
this.parent.fireEvent("videolistpage");

}
} }

}

],
hide: {
element: 'component',
fn: function () {
alert("in hide");
//this.parent.fireEvent("stopmask");

}


}
}

});

mitchellsimoens
20 Jan 2013, 7:44 AM
You can have the poster as a loading image. Once the file is downloaded it will fire the canplaythrough event which you can then play the video.

sandeepmnit35
20 Jan 2013, 9:40 PM
I want to remove this intermediate screen and play the video automatically in native player. I am okay to show a loading popup untill it load the video and play it. What media event we can use if we are clicking on done button of native player without playing the video fully.

sandeepmnit35
21 Jan 2013, 4:23 AM
Is it possible that we open the native player immediately after the video view screen is activated by skiping the poster image loading screen?

Does sencha handle any media event which is fired after clicking the done button of native player in iphone without playing the full video?

=NR=
30 Sep 2014, 3:47 AM
Is it possible that we open the native player immediately after the video view screen is activated by skiping the poster image loading screen?

Does sencha handle any media event which is fired after clicking the done button of native player in iphone without playing the full video?

well the html5 video tag specification have attribute for "autoplay",

assuming somehow you can access the component either after painted on dom by attached listener or when defining the class you can access that html5's attribute and set it to true.

if you are using the painted event it should be something like following:



Ext.ComponentQuery.query('#yourVideoContainerId > video')[0].media.dom.autoplay = true

*the sample above will only take your first video component in your container