Index: mythtv/programs/mythbackend/mythxml.cpp
===================================================================
--- mythtv/programs/mythbackend/mythxml.cpp	(revision 27361)
+++ mythtv/programs/mythbackend/mythxml.cpp	(arbetskopia)
@@ -123,6 +123,7 @@
     if (sURI == "GetVideoArt"           ) return MXML_GetVideoArt;
     if (sURI == "GetInternetSearch"     ) return MXML_GetInternetSearch;
     if (sURI == "GetInternetSources"    ) return MXML_GetInternetSources;
+    if (sURI == "GetInternetContent"    ) return MXML_GetInternetContent;
 
     return MXML_Unknown;
 }
@@ -229,6 +230,9 @@
                 case MXML_GetInternetSources :
                     GetInternetSources( pRequest );
                     return true;
+                case MXML_GetInternetContent :
+                    GetInternetContent( pRequest );
+                    return true;
 
                 case MXML_GetConnectionInfo    :
                     GetConnectionInfo( pRequest );
@@ -1662,6 +1666,34 @@
     pRequest->FormatActionResponse( list );
 }
 
+void MythXML::GetInternetContent( HTTPRequest *pRequest )
+{
+    pRequest->m_eResponseType   = ResponseTypeHTML;
+
+    QString grabber =  pRequest->m_mapParams[ "Grabber" ];
+
+    if (grabber.isEmpty())
+        return;
+
+    QString contentDir = QString("%1internetcontent/").arg(GetShareDir());
+    QString htmlFile(contentDir + grabber);
+
+    // Try to prevent directory traversal
+    QFileInfo fileInfo(htmlFile);
+    if (fileInfo.canonicalFilePath().startsWith(contentDir) &&
+        QFile::exists( htmlFile ))
+    {
+        pRequest->m_eResponseType   = ResponseTypeFile;
+        pRequest->m_nResponseStatus = 200;
+        pRequest->m_sFileName       = htmlFile;
+    }
+    else
+    {
+        pRequest->FormatRawResponse( QString("<HTML>File %1 does "
+                  "not exist!</HTML>").arg(htmlFile) );
+    }
+}
+
 /////////////////////////////////////////////////////////////////////////////
 //
 /////////////////////////////////////////////////////////////////////////////
Index: mythtv/programs/mythbackend/mythxml.h
===================================================================
--- mythtv/programs/mythbackend/mythxml.h	(revision 27361)
+++ mythtv/programs/mythbackend/mythxml.h	(arbetskopia)
@@ -54,10 +54,11 @@
     MXML_GetVideoArt            = 17,
     MXML_GetInternetSearch      = 18,
     MXML_GetInternetSources     = 19,
+    MXML_GetInternetContent     = 20,
 
-    MXML_GetFile                = 20,
-    MXML_GetFileList            = 21,
-    MXML_GetFileLinks           = 22,
+    MXML_GetFile                = 21,
+    MXML_GetFileList            = 22,
+    MXML_GetFileLinks           = 23,
 
 } MythXMLMethod;
 
@@ -127,6 +128,7 @@
 
         void    GetInternetSearch( HTTPRequest *pRequest );
         void    GetInternetSources( HTTPRequest *pRequest );
+        void    GetInternetContent( HTTPRequest *pRequest );
 
         void    GetDeviceDesc  ( HTTPRequest *pRequest );
         void    GetFile        ( HTTPRequest *pRequest, QString sFileName );
Index: mythplugins/mythbrowser/mythbrowser/bookmarkmanager.cpp
===================================================================
--- mythplugins/mythbrowser/mythbrowser/bookmarkmanager.cpp	(revision 27361)
+++ mythplugins/mythbrowser/mythbrowser/bookmarkmanager.cpp	(arbetskopia)
@@ -19,6 +19,7 @@
 #include "bookmarkeditor.h"
 #include "browserdbutil.h"
 #include "mythbrowser.h"
+#include "mythflashplayer.h"
 
 // ---------------------------------------------------
 
@@ -381,7 +382,11 @@
     {
         MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
 
-        MythBrowser *mythbrowser = new MythBrowser(mainStack, urls, zoom.toFloat());
+        MythScreenType *mythbrowser;
+        if (urls[0].startsWith("mythflash://"))
+            mythbrowser = new MythFlashPlayer(mainStack, urls);
+        else
+            mythbrowser = new MythBrowser(mainStack, urls, zoom.toFloat());
 
         if (mythbrowser->Create())
         {
Index: mythplugins/mythbrowser/mythbrowser/mythflashplayer.h
===================================================================
--- mythplugins/mythbrowser/mythbrowser/mythflashplayer.h	(revision 0)
+++ mythplugins/mythbrowser/mythbrowser/mythflashplayer.h	(revision 0)
@@ -0,0 +1,25 @@
+#ifndef MYTHFLASHPLAYER_H
+#define MYTHFLASHPLAYER_H
+
+#include <mythscreentype.h>
+
+class MythUIWebBrowser;
+
+class MythFlashPlayer : public MythScreenType
+{
+  Q_OBJECT
+
+  public:
+    MythFlashPlayer(MythScreenStack *parent, QStringList &urlList);
+    ~MythFlashPlayer();
+
+    bool Create(void);
+    bool keyPressEvent(QKeyEvent *);
+
+  private:
+    QVariant evaluateJavaScript(const QString&);
+    MythUIWebBrowser*         m_browser;
+    QString                   m_url;
+};
+
+#endif
Index: mythplugins/mythbrowser/mythbrowser/mythbrowser.pro
===================================================================
--- mythplugins/mythbrowser/mythbrowser/mythbrowser.pro	(revision 27361)
+++ mythplugins/mythbrowser/mythbrowser/mythbrowser.pro	(arbetskopia)
@@ -16,9 +16,9 @@
 INSTALLS += installimages
 
 # Input
-HEADERS += mythbrowser.h webpage.h 
+HEADERS += mythbrowser.h mythflashplayer.h webpage.h 
 HEADERS += bookmarkmanager.h bookmarkeditor.h browserdbutil.h
-SOURCES += main.cpp mythbrowser.cpp webpage.cpp
+SOURCES += main.cpp mythbrowser.cpp mythflashplayer.cpp webpage.cpp
 SOURCES += bookmarkmanager.cpp bookmarkeditor.cpp browserdbutil.cpp
 
 include ( ../../libs-targetfix.pro )
Index: mythplugins/mythbrowser/mythbrowser/main.cpp
===================================================================
--- mythplugins/mythbrowser/mythbrowser/main.cpp	(revision 27361)
+++ mythplugins/mythbrowser/mythbrowser/main.cpp	(arbetskopia)
@@ -15,6 +15,7 @@
 #include "bookmarkmanager.h"
 #include "browserdbutil.h"
 #include "mythbrowser.h"
+#include "mythflashplayer.h"
 
 using namespace std;
 
@@ -30,9 +31,12 @@
     float zoom = gCoreContext->GetSetting("WebBrowserZoomLevel", "1.4").toFloat();
 
     MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+    MythScreenType *mythbrowser;
+    if (urls[0].startsWith("mythflash://"))
+        mythbrowser = new MythFlashPlayer(mainStack, urls);
+    else
+        mythbrowser = new MythBrowser(mainStack, urls, zoom);
 
-    MythBrowser *mythbrowser = new MythBrowser(mainStack, urls, zoom);
-
     if (mythbrowser->Create())
         mainStack->AddScreen(mythbrowser);
     else
Index: mythplugins/mythbrowser/mythbrowser/mythflashplayer.cpp
===================================================================
--- mythplugins/mythbrowser/mythbrowser/mythflashplayer.cpp	(revision 0)
+++ mythplugins/mythbrowser/mythbrowser/mythflashplayer.cpp	(revision 0)
@@ -0,0 +1,98 @@
+#include <stdlib.h>
+#include <iostream>
+
+// qt
+#include <QApplication>
+#include <QEvent>
+
+// myth
+#include <mythverbose.h>
+#include <mythcontext.h>
+#include <libmythui/mythmainwindow.h>
+#include <mythuiwebbrowser.h>
+
+// mythbrowser
+#include "webpage.h"
+#include "mythflashplayer.h"
+
+using namespace std;
+
+MythFlashPlayer::MythFlashPlayer(MythScreenStack *parent,
+                         QStringList &urlList)
+    : MythScreenType (parent, "mythflashplayer"),
+      m_browser(NULL), m_url(urlList[0])
+{
+    qApp->setOverrideCursor(QCursor(Qt::BlankCursor));
+}
+
+
+MythFlashPlayer::~MythFlashPlayer()
+{
+    qApp->restoreOverrideCursor();
+
+    if (m_browser)
+    {
+        m_browser->disconnect();
+        DeleteChild(m_browser);
+        m_browser = NULL;
+    }
+}
+
+bool MythFlashPlayer::Create(void)
+{
+    m_browser = new MythUIWebBrowser(this, "mythflashplayer");
+    m_browser->SetArea(GetMythMainWindow()->GetUIScreenRect());
+    m_browser->Init();
+    m_browser->SetActive(true);
+    m_browser->Show();
+
+    BuildFocusList();
+
+    SetFocusWidget(m_browser);
+
+    m_url.replace("mythflash://", "http://");
+    VERBOSE(VB_GENERAL, QString("Opening %1").arg(m_url));
+    m_browser->LoadPage(QUrl::fromEncoded(m_url.toLocal8Bit()));
+
+    return true;
+}
+
+QVariant MythFlashPlayer::evaluateJavaScript(const QString& source)
+{
+    return m_browser->evaluateJavaScript(source);
+}
+
+bool MythFlashPlayer::keyPressEvent(QKeyEvent *event)
+{
+    QStringList actions;
+    bool handled = GetMythMainWindow()->TranslateKeyPress("TV Playback", event, actions);
+
+    for (int i = 0; i < actions.size() && !handled; i++)
+    {
+        QString action = actions[i];
+        handled = true;
+
+        if (action == "PAUSE")
+            evaluateJavaScript("play();");
+        else if (action == "SEEKFFWD")
+            evaluateJavaScript("seek(10);");
+        else if (action == "SEEKRWND")
+            evaluateJavaScript("seek(-10);");
+        else if (action == "CHANNELUP")
+            evaluateJavaScript("seek(60);");
+        else if (action == "CHANNELDOWN")
+            evaluateJavaScript("seek(-60);");
+        else
+            handled = false;
+
+        if (handled)
+            return true;
+    }
+
+    handled = m_browser->keyPressEvent(event);
+
+    if (!handled && MythScreenType::keyPressEvent(event))
+        handled = true;
+
+    return handled;
+}
Index: mythtv/libs/libmythui/mythuiwebbrowser.h
===================================================================
--- mythtv/libs/libmythui/mythuiwebbrowser.h	(revision 27361)
+++ mythtv/libs/libmythui/mythuiwebbrowser.h	(arbetskopia)
@@ -72,6 +72,8 @@
     bool CanGoForward(void);
     bool CanGoBack(void);
 
+    QVariant evaluateJavaScript(const QString& scriptSource);
+
   public slots:
     void Back(void);
     void Forward(void);
Index: mythtv/libs/libmythui/mythuiwebbrowser.cpp
===================================================================
--- mythtv/libs/libmythui/mythuiwebbrowser.cpp	(revision 27361)
+++ mythtv/libs/libmythui/mythuiwebbrowser.cpp	(arbetskopia)
@@ -322,6 +322,7 @@
 {
     if (m_browser)
     {
+        m_browser->hide();
         m_browser->disconnect();
         m_browser->deleteLater();
         m_browser = NULL;
@@ -551,6 +552,18 @@
         return QUrl();
 }
 
+/** \fn MythUIWebBrowser::evaluateJavaScript(const QString& scriptSource)
+ *  \brief Evaluates the JavaScript code in \a scriptSource.
+ *  \return QVariant
+ */
+QVariant MythUIWebBrowser::evaluateJavaScript(const QString& scriptSource)
+{
+    if (m_browser)
+        return m_browser->page()->mainFrame()->evaluateJavaScript(scriptSource);
+    else
+        return QVariant();
+}
+
 void MythUIWebBrowser::slotLoadStarted(void)
 {
     emit loadStarted();
Index: mythtv/bindings/python/MythTV/methodheap.py
===================================================================
--- mythtv/bindings/python/MythTV/methodheap.py	(revision 27361)
+++ mythtv/bindings/python/MythTV/methodheap.py	(arbetskopia)
@@ -995,6 +995,10 @@
                         find('InternetContent').findall('grabber'):
             yield InternetSource.fromEtree(grabber, self)
 
+    def getInternetContentUrl(self, grabber, videocode):
+        return "mythflash://%s:%s/Myth/GetInternetContent?Grabber=%s&videocode=%s" \
+            % (self.host, self.port, grabber, videocode)
+
     def getPreviewImage(self, chanid, starttime, width=None, \
                                                  height=None, secsin=None):
         starttime = datetime.duck(starttime)
Index: mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/vimeo_api.py
===================================================================
--- mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/vimeo_api.py	(revision 27361)
+++ mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/vimeo_api.py	(arbetskopia)
@@ -61,6 +61,7 @@
 import xml.etree.ElementTree as ET
 import inspect
 import oauth.oauth_api as oauth
+from MythTV import MythXML
 
 from vimeo_exceptions import (VimeoUrlError, VimeoHttpError, VimeoResponseError, VimeoVideoNotFound, VimeoRequestTokenError, VimeoAuthorizeTokenError, VimeoVideosSearchError, VimeoAllChannelError, __errmsgs__)
 
@@ -669,6 +670,7 @@
 
         """
         self.config = {}
+        self.mythxml = MythXML()
 
         self.config['debug_enabled'] = debug # show debugging messages
 
@@ -980,7 +982,9 @@
                         if url.get('type') == 'video':
                             if url.text: # Make the link fullscreen and auto play
                                 if embed_flag:
-                                    v_details[url.tag] = self.ampReplace(url.text.strip().replace(u'http://vimeo.com/', u'http://vimeo.com/moogaloop.swf?clip_id=')+u'&autoplay=1')
+                                    playerUrl = self.mythxml.getInternetContentUrl("nv_python_libs/configs/HTML/vimeo.html", \
+                                                                                   url.text.strip().replace(u'http://vimeo.com/', ''))
+                                    v_details[url.tag] = self.ampReplace(playerUrl)
                                 else:
                                     v_details[url.tag] = self.ampReplace(url.text.strip())
                             else:
Index: mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/vimeo.html
===================================================================
--- mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/vimeo.html	(revision 0)
+++ mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/vimeo.html	(revision 0)
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+    <head>
+        <style type="text/css">
+            body {
+                padding: 0;
+                margin: 0;
+            }
+        </style>
+        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
+        <script type="text/javascript">
+            /* gup function by R.D. Vaughan */
+            function gup( name )
+            {
+                name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
+                var regexS = "[\\?&]"+name+"=([^&#]*)";
+                var regex = new RegExp( regexS );
+                var results = regex.exec( window.location.href );
+                if( results == null )
+                    return "";
+                else
+                    return results[1];
+            }
+
+            var video_id = gup( 'videocode' );
+            var myth_player = false;
+            var paused = false;
+
+            function vimeo_player_loaded(swf_id) {
+                myth_player = document.getElementById(swf_id);
+                document.getElementById('controls').style.display = '';
+            }
+
+            function play() {
+                if (paused) {
+                    myth_player.api_play();
+                    paused = false;
+                }
+                else if (!paused) {
+                    myth_player.api_pause();
+                    paused = true;
+                }
+            }
+
+            function seek(amount) {
+                if (myth_player) {
+                    myth_player.api_seekTo(myth_player.api_getCurrentTime() + amount);
+                }
+            }
+
+            var flashvars = {
+                clip_id: video_id,
+                show_portrait: 1,
+                show_byline: 1,
+                show_title: 1,
+                fp_version: 10,
+                js_api: 1, // required in order to use the Javascript API
+                js_onLoad: 'vimeo_player_loaded', // moogaloop will call this JS function when it's done loading (optional)
+                js_swf_id: 'myth_player' // this will be passed into all event methods so you can keep track of multiple moogaloops (optional)
+            };
+            var params = {
+                allowscriptaccess: 'always',
+                allowfullscreen: 'true',
+                wmode: 'opaque',
+                
+            };
+            var attributes = {};
+
+            // For more SWFObject documentation visit: http://code.google.com/p/swfobject/wiki/documentation
+            swfobject.embedSWF("http://vimeo.com/moogaloop.swf?autoplay=1", "myth_player", window.innerWidth, window.innerHeight, "9.0.0","expressInstall.swf", flashvars, params, attributes);
+        </script>
+    </head>
+    <body>
+        <div id="myth_player"/>
+    </body>
+</html>
Index: mythtv/programs/scripts/internetcontent/nv_python_libs/youtube/youtube_api.py
===================================================================
--- mythtv/programs/scripts/internetcontent/nv_python_libs/youtube/youtube_api.py	(revision 27361)
+++ mythtv/programs/scripts/internetcontent/nv_python_libs/youtube/youtube_api.py	(arbetskopia)
@@ -38,6 +38,7 @@
 import os, struct, sys, re, time
 import urllib, urllib2
 import logging
+from MythTV import MythXML
 
 try:
     import xml.etree.cElementTree as ElementTree
@@ -148,6 +149,7 @@
 
         """
         self.config = {}
+        self.mythxml = MythXML()
 
         if apikey is not None:
             self.config['apikey'] = apikey
@@ -522,7 +524,13 @@
                                 continue
                             if not elem.get(key) == '5':
                                 continue
-                            item['video'] = self.ampReplace((elem.get('url')+'&autoplay=1'))
+                            m = re.search("/v/([^?]+)", elem.get("url"))
+                            if m:
+                                url = self.mythxml.getInternetContentUrl("nv_python_libs/configs/HTML/youtube.html", \
+                                                                         m.group(1))
+                                item['video'] = self.ampReplace(url)
+                            else:
+                                item['video'] = self.ampReplace((elem.get('url')+'&autoplay=1'))
                             flash = True
                         continue
             if not item.has_key('video'):
Index: mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/youtube.html
===================================================================
--- mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/youtube.html	(revision 27361)
+++ mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/youtube.html	(arbetskopia)
@@ -1,30 +1,76 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
 <html>
-  <head>
-  <!-- Author: R.D. Vaughan
-       Apr 28th, 2010
-       Purpose: Implement full screen browser video display for the BBC iPlayer
-  Example:
-  file:///usr/local/share/mythtv/mythnetvision/scripts/nv_python_libs/configs/HTML/bbciplayer.html?videocode=b00s5nfv
-  -->
-    <script type="text/javascript">
-      function gup( name )
-        {
-          name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
-          var regexS = "[\\?&]"+name+"=([^&#]*)";
-          var regex = new RegExp( regexS );
-          var results = regex.exec( window.location.href );
-          if( results == null )
-            return "";
-          else
-            return results[1];
-        }
+    <head>
+        <style type="text/css">
+            body {
+                padding: 0;
+                margin: 0;
+            }
+        </style>
 
-      var videocode = gup( 'videocode' );
-      var embedded = '<embed height="98%" width="100%" type="application/x-shockwave-flash" src="http://s.ytimg.com/yt/swf/watch-vfl170492.swf" id="movie_player" flashvars="rv.7.length_seconds=136&amp;rv.2.thumbnailUrl=http%3A%2F%2Fi2.ytimg.com%2Fvi%2FIFhhaXDziZ4%2Fdefault.jpg&amp;rv.0.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBf04aUZMIVQ&amp;rv.0.view_count=28868&amp;vq=auto&amp;rv.6.author=krlitosito&amp;rv.3.view_count=34084&amp;rv.0.length_seconds=251&amp;rv.4.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FzI9C9j0QgU4%2Fdefault.jpg&amp;fmt_url_map=34%7Chttp%3A%2F%2Fv11.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D34%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D977BE213A3E74A1B3597CC270D8990872B299745.B36097223339C126F6C108E54090CDAEFE383D73%26factor%3D1.25%26id%3Db9493e8e24226592%2C5%7Chttp%3A%2F%2Fv14.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D5%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D42F8774F51ED24983133B8D8F797908F97D8C371.3B0C17A6728074833130840B82BE167F4CA1035D%26factor%3D1.25%26id%3Db9493e8e24226592&amp;csi_page_type=wwad&amp;cr=CA&amp;rv.1.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPzeRpPSZOjI&amp;rv.6.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FBwBz4h_4POA%2Fdefault.jpg&amp;host_language=en&amp;rv.3.rating=4.92660550459&amp;fmt_list=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&amp;rv.7.id=P5y-yjheRKE&amp;targeting_video_doc_id=&amp;rv.0.rating=4.97297297297&amp;invideo=True&amp;rv.5.id=6oHEgkK9wj0&amp;tk=Rqbx09U3FZ_vusI7vVWVX-zIbWbZAIm1Q2GN6gt7W3SQKWb-qm-Lvw%3D%3D&amp;sffb=True&amp;rv.0.id=Bf04aUZMIVQ&amp;rv.5.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6oHEgkK9wj0&amp;timestamp=1276178843&amp;rv.0.author=WaspEnterprise&amp;rv.3.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2F663CI_o4sTY%2Fdefault.jpg&amp;rv.2.author=8Etech8&amp;rv.6.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBwBz4h_4POA&amp;ad_host=ca-host-pub-4790912793353039&amp;ad_eurl=http%3A%2F%2Fwww.youtube.com%2Fvideo%2FVIDEOCODE&amp;mpu=True&amp;hl=en_US&amp;ad_flags=1&amp;rv.0.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FBf04aUZMIVQ%2Fdefault.jpg&amp;rv.5.length_seconds=282&amp;rv.7.author=krlitosito&amp;rv.5.view_count=7517&amp;rv.1.length_seconds=251&amp;rv.3.id=663CI_o4sTY&amp;rv.2.id=IFhhaXDziZ4&amp;rv.2.length_seconds=316&amp;t=vjVQa1PpcFMjs5n51hkGar4Hp9uA3GYTt6LvegEYo00%3D&amp;rv.6.id=BwBz4h_4POA&amp;cafe_experiment_id=&amp;rv.6.view_count=2565&amp;rv.3.author=krlitosito&amp;rv.4.id=zI9C9j0QgU4&amp;fexp=902303%2C906712&amp;allow_embed=1&amp;ad_host_tier=54235&amp;fmt_stream_map=34%7Chttp%3A%2F%2Fv11.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D34%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D977BE213A3E74A1B3597CC270D8990872B299745.B36097223339C126F6C108E54090CDAEFE383D73%26factor%3D1.25%26id%3Db9493e8e24226592%2C5%7Chttp%3A%2F%2Fv14.lscache2.c.youtube.com%2Fvideoplayback%3Fip%3D99.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Calgorithm%252Cburst%252Cfactor%26fexp%3D902303%252C906712%26algorithm%3Dthrottle-factor%26itag%3D5%26ipbits%3D8%26burst%3D40%26sver%3D3%26expire%3D1276203600%26key%3Dyt1%26signature%3D42F8774F51ED24983133B8D8F797908F97D8C371.3B0C17A6728074833130840B82BE167F4CA1035D%26factor%3D1.25%26id%3Db9493e8e24226592&amp;rv.2.rating=4.88311688312&amp;shownextbutton=1&amp;rv.1.id=PzeRpPSZOjI&amp;rv.4.length_seconds=228&amp;ad_logging_flag=1&amp;rv.7.view_count=3940&amp;rv.6.length_seconds=253&amp;length_seconds=295&amp;fmt_map=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&amp;enablejsapi=1&amp;video_id=VIDEOCODE&amp;plid=AASIrYqnNA1liVSJ&amp;afv=True&amp;rv.5.rating=4.98&amp;ad_tag=http%3A%2F%2Fad-g.doubleclick.net%2Fpfadx%2Fcom.ytpwatch.music%2Fmain_6%3Bsz%3DWIDTHxHEIGHT%3Bmpvid%3DAASIrYqpBw0C8F4n%3B%21c%3D6%3Bytexp%3D902303.906712%3Bytps%3Ddefault%3Bklg%3Den%3Bkvid%3DVIDEOCODE%3Bctb%3D1%3Bkt%3DK%3Bko%3Dc%3Bkpid%3D6%3Bkga%3D-1%3Bkr%3DN%3Bshortform%3D1%3Bu%3DVIDEOCODE%7C6%3Bkgg%3D-1%3Bkcr%3Dca%3Bafv%3D1%3Bkhd%3D0%3Bdc_dedup%3D1%3Bkpu%3Desther1208%3B&amp;ad_video_pub_id=ca-pub-6219811747049371&amp;rv.4.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzI9C9j0QgU4&amp;rv.1.author=0rganix&amp;rv.1.rating=4.97674418605&amp;rv.5.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2F6oHEgkK9wj0%2Fdefault.jpg&amp;watermark=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf&amp;rv.7.rating=4.73333333333&amp;rv.3.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D663CI_o4sTY&amp;rv.2.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIFhhaXDziZ4&amp;cid=6&amp;rv.7.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DP5y-yjheRKE&amp;rv.2.view_count=31320&amp;ad_channel_code_overlay=invideo_overlay_480x70_cat10%2Cafv_overlay%2Cafv_ugc%2Cytps_default%2Cyt_mpvid_AASIrYqpBw0C8F4n%2Cyt_cid_6%2Cytexp_902303.906712&amp;rv.4.view_count=1325763&amp;ad_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fad-vfl170492.swf&amp;rv.1.view_count=22657&amp;dclk=True&amp;rv.6.rating=5.0&amp;sk=lsWSaZl1UFLCUxUw44Lon-hoi_2GTCy-C&amp;ctb=True&amp;rv.1.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FPzeRpPSZOjI%2Fdefault.jpg&amp;mpvid=AASIrYqpBw0C8F4n&amp;rv.3.length_seconds=330&amp;rv.5.author=Ulrick31&amp;rv.4.rating=4.90052939537" allowscriptaccess="always" allowfullscreen="true" bgcolor="#000000" />';
-      document.write('<title>YouTube Full Screen</title>');
-      document.write(embedded.replace(/VIDEOCODE/g, videocode));
+        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
+        <script type="text/javascript">
+            /* gup function by R.D. Vaughan */
+            function gup( name )
+            {
+                name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
+                var regexS = "[\\?&]"+name+"=([^&#]*)";
+                var regex = new RegExp( regexS );
+                var results = regex.exec( window.location.href );
+                if( results == null )
+                    return "";
+                else
+                    return results[1];
+            }
 
-    </script>
-  </head>
+            var myth_player = null;
+
+            var params = {
+            allowScriptAccess: "always",
+                            allowfullscreen: 'true',
+                            wmode: 'opaque'
+            };
+            var atts = { id: "myytplayer" };
+            swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=ytplayer", 
+                               "myth_player", window.innerWidth, window.innerHeight, "8", null, null, params, atts);
+
+            function onYouTubePlayerReady(playerId) {
+                myth_player = document.getElementById("myytplayer");
+                var videocode = gup('videocode');
+                if (videocode != "") {
+                    myth_player.cueVideoById(videocode);
+                    myth_player.playVideo();
+                }
+            }
+
+            function play() {
+                if (myth_player) {
+                    var state = myth_player.getPlayerState();
+                    if (state == 1) // Playing
+                        myth_player.pauseVideo();
+                    else if (state != 3) // Video is either unstarted, ended, paused or cued
+                        myth_player.playVideo();
+                }
+            }
+
+            function seek(amount) {
+                if (myth_player) {
+                    myth_player.seekTo(myth_player.getCurrentTime() + amount, true);
+                }
+            }
+
+            window.onresize = function() {
+                document.body.style.width = window.innerWidth;
+                document.body.style.height = window.innerHeight;
+                if (myth_player) {
+                    //             myth_player.setSize(window.innerWidth, window.innerHeight);
+                    document.getElementById("myytplayer").width = window.innerWidth;
+                    document.getElementById("myytplayer").height = window.innerHeight;
+                }
+            };
+        </script>
+    </head>
+    <body>
+        <div id="myth_player"/>
+    </body>
 </html>
