Results 1 to 5 of 5

Thread: Video media event handling

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
      0  

    Default Video media event handling

    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.

    HTML Code:
    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");
                    
                        }
    
    
    }
    }
    
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    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.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
      0  

    Default

    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.

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
      0  

    Default

    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?

  5. #5
    Sencha User =NR='s Avatar
    Join Date
    Mar 2013
    Location
    Singapore
    Posts
    115
    Vote Rating
    -1
      0  

    Default

    Quote Originally Posted by sandeepmnit35 View Post
    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:

    Code:
    Ext.ComponentQuery.query('#yourVideoContainerId > video')[0].media.dom.autoplay = true
    *the sample above will only take your first video component in your container

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •