3

How can I stop or pause a YouTube Video from playing when I go to another page

In Sencha Touch2 Here is my code it seems like it should work but Video still plays.

Ext.define('MyApp.view.tablet.Home5', {
extend: 'Ext.Panel',
xtype: 'home5',

config: {
    scrollable: true,
    cls:'logo',

    items:[
        {
            xtype: 'panel',
            id: 'videopanel',
            html:[
                '<div id="video1"><iframe width="560" height="315" src="http://www.youtube.com/embed/NSUucup09Hc?fs=1&amp;hl=en_US&amp;rel=0&autoplay=0" frameborder="0" allowfullscreen></iframe></div>',
                '<img src="resources/images/thapelo3Fy.jpg" />'
            ].join("")
        }
    ]
},

hide: function(container, options){
    this.callParent(arguments);

    //workaround to stop the video (= reset the html)
    Ext.getCmp('videopanel').setHtml("");
    Ext.getCmp('videopanel').setHtml('<div id="video1"><iframe width="560" height="315" src="http://www.youtube.com/embed/NSUucup09Hc?fs=1&amp;hl=en_US&amp;rel=0&autoplay=0" frameborder="0" allowfullscreen></iframe></div><img src="resources/images/thapelo3Fy.jpg" />');
}
});  
2

1 Answer 1

0

How can I stop a video with Javascript in Youtube? is what you need to do. Would have typed it here, but on my mobile...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.