View Full Version : Displaying YouTube video in Android via PhoneGap

28 May 2011, 10:14 AM
I'm not sure this is a SenchaTouch issue but some people here may have had the same experience.

My app is targeted for Android and iPhone via PhoneGap. I have an iframe in a tabpanel for playing a Youtube video. It works fine in desktop Chrome. Though the console shows this error on load (not play):

Unsafe JavaScript attempt to access frame with URL file:///C:/Users/Mark%20Murphy/workspace/Volved/assets/www/index.html from frame with URL http://www.youtube.com/embed/vSVioxUxLk0?rel=0&showsearch=0&showinfo=0&fs=1. Domains, protocols and ports must match.

On Android device, this code will display the start frame of my video. When I touch to start the video, it goes black and then returns to the start frame after about a second.

Here is the code:

var tplVideo = new Ext.XTemplate(
'<div class="none"><iframe class="youtube-player" type="text/html" width="400" height="300" ',

// About tab
var tabAbout = new Ext.Panel ( {
title: 'About',
cls: 'about',
layout: {
type: 'vbox',
pack: 'center'

items: [
//posterUrl: 'img/Default.png'