Adding video using Sencha

£可爱£侵袭症+ 提交于 2019-12-06 06:38:11

问题


I want to add a youtube video in my site using Sencha. I use the following code:

 var pnl = new Ext.Panel({
            layout: {
                type: 'vbox',
                pack: 'center'
            },
            items: [{
                xtype:'video',
                url: "space.mp4",
                loop: true,
                width: 500,
                height: 400,
                poster: 'Screenshot.png'
            }],
            fullscreen: true
        })

Here I replace the space.mp4 with a youtube url but it doesn't work. If I write html:'you tube link', it works on the browser on my system, but not on iPhone.

How can I make this work?


回答1:


One workaround is to embed the video with the embed code (iframe) provided by youtube. Just give your component the html attribute with the iframe code, e.g.:

html: '<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/1VcZ5eOwHQA" frameborder="0" allowfullscreen></iframe>'


来源:https://stackoverflow.com/questions/3957250/adding-video-using-sencha

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!