Results 1 to 10 of 10

Thread: Autoplay video

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext User
    Join Date
    Jun 2010
    Posts
    19
    Vote Rating
    0
      0  

    Default Autoplay video

    Hi,

    I was checking the API for video and I didn't see any sort of autoplay config option or for that matter any play(0 method.

    Is there some way to autoplay a video as soon as it loads?

    I'd like to add video help in an overlay so it would make sense if it started when opened.

    Here is the test code I am using:

    Code:
    Ext.setup({
        tabletStartupScreen: 'tablet_startup.png',
        phoneStartupScreen: 'phone_startup.png',
        icon: 'icon.png',
        glossOnIcon: false,
        onReady: function() {
            var pnl = new Ext.Panel({
                layout: {
                    type: 'vbox',
                    pack: 'center'
                },
                items: [{
                    xtype: 'video',
                    url: 'test3.mp4',
                    loop: true,
                    width: 480,
                    height: 360,
                    poster: 'poster.png'
                }],
                fullscreen: true
            })
        }
    });
    Thanks as always for the help!

    gt

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,382
    Vote Rating
    858
      0  

    Default

    There's actually play/pause and an autoPlay config on the video object, however they don't appear in the docs.

    I'll fix that up now.

    The autoPlay code needs a bit of refactoring as well, since it only fires when the component is "activated". In the video example, it's never activated, because it's not part of a card type layout.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    Jun 2010
    Posts
    19
    Vote Rating
    0
      0  

    Default

    Thanks for the update Evan.

    How about this:

    I have a button that opens up the overlay that contains the video as I described before. Could I add some code to start the video playing from my handler?

    Here are the two pieces of code:

    Code:
            var videoOverlay = new Ext.Panel({
                floating: true,
                modal: true,
                centered: true,
                items: [{
                	id: 'vid',
                    xtype: 'video',
                    url: 'test3.mp4',
                    loop: false,
                    width: 480,
                    height: 360,
                    poster: 'poster.png'
                }]
           	 });
           	 
     
     var showVideo = function(button, event) {
     console.info('show video');
     				
     	          videoOverlay.setCentered(true);
                
                videoOverlay.show();
     
     }
    Any and all help would be greatly appreciated!

    Thanks,
    gt

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,382
    Vote Rating
    858
      0  
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Ext User
    Join Date
    Jun 2010
    Posts
    19
    Vote Rating
    0
      0  

    Default

    I guess from an autoPlay perspective I'm out of luck.

    What about programmatically playing the video like the example in your link? Is there a simpler way to play the video within the Sencha API?

    Hopefully that makes sense...

    Thanks,
    gt

  6. #6
    Ext User
    Join Date
    Aug 2010
    Posts
    3
    Vote Rating
    0
      0  

    Default

    here is a sample of how it might work...

    http://www.codeblog.co/getting-autoplay-working-on-ios/

    what I need to understand is how to get the video to stop playing the audio once you click outside the modal...

Similar Threads

  1. Video in Carousel
    By ludm in forum Sencha Touch 1.x: Discussion
    Replies: 7
    Last Post: 30 Mar 2011, 1:11 PM
  2. Carousel AutoPlay
    By mobigeni in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 6 Jul 2010, 12:45 PM
  3. to open a video
    By sakaext in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 2 Oct 2009, 12:39 AM
  4. video streming
    By andryi in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 5 Aug 2009, 10:24 AM
  5. Gmail: A Behind the Scenes Video
    By mystix in forum Community Discussion
    Replies: 0
    Last Post: 10 Aug 2007, 5:33 AM

Posting Permissions

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