Adding videos using Sencha

I want to add a video to YouTube using Sencha. I am using 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 am replacing space.mp4youtube with the url, but it does not work. If I write html:'you tube link', it works in the browser on my system, but not on the iPhone.

How can I do this job?

+3
source share
1 answer

A workaround is to embed a video with an iframe code provided by youtube. Just give your component an html attribute with iframe code, for example:

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

Source: https://habr.com/ru/post/1770055/


All Articles