youtube - Sencha Touch2 当我转到另一个页面时停止 YouTube 视频

标签 youtube sencha-touch-2

如何在转到另一个页面时停止或暂停播放 YouTube 视频

在 Sencha Touch2 中,这是我的代码,它似乎应该可以工作,但视频仍在播放。

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" />');
}
});  

最佳答案

How can I stop a video with Javascript in Youtube?是你需要做的。本来可以在这里输入的,但是在我的手机上...

关于youtube - Sencha Touch2 当我转到另一个页面时停止 YouTube 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10860465/

相关文章:

javascript - Sencha Touch - View 内的调用功能不会被调用

extjs - Sencha 触摸 2 : How to reference self in class definition

javascript - GDPR : youtube-nocookie embedded URL's, 需要访问者的许可吗?

angularjs - 将youtube视频嵌入到iFrame中

javascript - 在 Sencha Touch 2.4.0 中实现路由

sencha-touch - 如何为 Sencha Touch 2.x 应用程序生成脚手架?

sencha-touch-2 - Sencha touch 2 标题省略号

iphone - 有关在 iPhone 上使用 Google GData API - Youtube 的任何示例/教程吗?

c# - Youtube API 无效搜索查询 invalidSearchFilter 错误

youtube - YouTube:有什么方法可以获取用户观看的视频列表?