2010-10-18 81 views
3

我想使用Sencha在我的網站中添加YouTube視頻。我使用下面的代碼:使用Sencha添加視頻

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 
     }) 

在這裏,我有一個YouTube網址替換space.mp4,但它不工作。如果我寫html:'you tube link',它適用於我的系統上的瀏覽器,但不適用於iPhone。

我該如何做這項工作?

+0

Anish,你設法得到這個固定?從Sencha v0.95(working)升級到v0.97(不工作)以來,我遇到同樣的問題? – carok 2010-11-15 16:08:05

回答

2

一種解決方法是使用youtube提供的嵌入代碼(iframe)嵌入視頻。只要給你的組件的HTML屬性與iframe代碼,例如:

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