Ticket #9301: mythflash.patch
File mythflash.patch, 27.5 KB (added by , 15 years ago) |
---|
-
mythtv/programs/mythbackend/mythxml.cpp
123 123 if (sURI == "GetVideoArt" ) return MXML_GetVideoArt; 124 124 if (sURI == "GetInternetSearch" ) return MXML_GetInternetSearch; 125 125 if (sURI == "GetInternetSources" ) return MXML_GetInternetSources; 126 if (sURI == "GetInternetContent" ) return MXML_GetInternetContent; 126 127 127 128 return MXML_Unknown; 128 129 } … … 229 230 case MXML_GetInternetSources : 230 231 GetInternetSources( pRequest ); 231 232 return true; 233 case MXML_GetInternetContent : 234 GetInternetContent( pRequest ); 235 return true; 232 236 233 237 case MXML_GetConnectionInfo : 234 238 GetConnectionInfo( pRequest ); … … 1662 1666 pRequest->FormatActionResponse( list ); 1663 1667 } 1664 1668 1669 void MythXML::GetInternetContent( HTTPRequest *pRequest ) 1670 { 1671 pRequest->m_eResponseType = ResponseTypeHTML; 1672 1673 QString grabber = pRequest->m_mapParams[ "Grabber" ]; 1674 1675 if (grabber.isEmpty()) 1676 return; 1677 1678 QString contentDir = QString("%1internetcontent/").arg(GetShareDir()); 1679 QString htmlFile(contentDir + grabber); 1680 1681 // Try to prevent directory traversal 1682 QFileInfo fileInfo(htmlFile); 1683 if (fileInfo.canonicalFilePath().startsWith(contentDir) && 1684 QFile::exists( htmlFile )) 1685 { 1686 pRequest->m_eResponseType = ResponseTypeFile; 1687 pRequest->m_nResponseStatus = 200; 1688 pRequest->m_sFileName = htmlFile; 1689 } 1690 else 1691 { 1692 pRequest->FormatRawResponse( QString("<HTML>File %1 does " 1693 "not exist!</HTML>").arg(htmlFile) ); 1694 } 1695 } 1696 1665 1697 ///////////////////////////////////////////////////////////////////////////// 1666 1698 // 1667 1699 ///////////////////////////////////////////////////////////////////////////// -
mythtv/programs/mythbackend/mythxml.h
54 54 MXML_GetVideoArt = 17, 55 55 MXML_GetInternetSearch = 18, 56 56 MXML_GetInternetSources = 19, 57 MXML_GetInternetContent = 20, 57 58 58 MXML_GetFile = 2 0,59 MXML_GetFileList = 2 1,60 MXML_GetFileLinks = 2 2,59 MXML_GetFile = 21, 60 MXML_GetFileList = 22, 61 MXML_GetFileLinks = 23, 61 62 62 63 } MythXMLMethod; 63 64 … … 127 128 128 129 void GetInternetSearch( HTTPRequest *pRequest ); 129 130 void GetInternetSources( HTTPRequest *pRequest ); 131 void GetInternetContent( HTTPRequest *pRequest ); 130 132 131 133 void GetDeviceDesc ( HTTPRequest *pRequest ); 132 134 void GetFile ( HTTPRequest *pRequest, QString sFileName ); -
mythplugins/mythbrowser/mythbrowser/bookmarkmanager.cpp
19 19 #include "bookmarkeditor.h" 20 20 #include "browserdbutil.h" 21 21 #include "mythbrowser.h" 22 #include "mythflashplayer.h" 22 23 23 24 // --------------------------------------------------- 24 25 … … 381 382 { 382 383 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 383 384 384 MythBrowser *mythbrowser = new MythBrowser(mainStack, urls, zoom.toFloat()); 385 MythScreenType *mythbrowser; 386 if (urls[0].startsWith("mythflash://")) 387 mythbrowser = new MythFlashPlayer(mainStack, urls); 388 else 389 mythbrowser = new MythBrowser(mainStack, urls, zoom.toFloat()); 385 390 386 391 if (mythbrowser->Create()) 387 392 { -
mythplugins/mythbrowser/mythbrowser/mythflashplayer.h
1 #ifndef MYTHFLASHPLAYER_H 2 #define MYTHFLASHPLAYER_H 3 4 #include <mythscreentype.h> 5 6 class MythUIWebBrowser; 7 8 class MythFlashPlayer : public MythScreenType 9 { 10 Q_OBJECT 11 12 public: 13 MythFlashPlayer(MythScreenStack *parent, QStringList &urlList); 14 ~MythFlashPlayer(); 15 16 bool Create(void); 17 bool keyPressEvent(QKeyEvent *); 18 19 private: 20 QVariant evaluateJavaScript(const QString&); 21 MythUIWebBrowser* m_browser; 22 QString m_url; 23 }; 24 25 #endif -
mythplugins/mythbrowser/mythbrowser/mythbrowser.pro
16 16 INSTALLS += installimages 17 17 18 18 # Input 19 HEADERS += mythbrowser.h webpage.h19 HEADERS += mythbrowser.h mythflashplayer.h webpage.h 20 20 HEADERS += bookmarkmanager.h bookmarkeditor.h browserdbutil.h 21 SOURCES += main.cpp mythbrowser.cpp webpage.cpp21 SOURCES += main.cpp mythbrowser.cpp mythflashplayer.cpp webpage.cpp 22 22 SOURCES += bookmarkmanager.cpp bookmarkeditor.cpp browserdbutil.cpp 23 23 24 24 include ( ../../libs-targetfix.pro ) -
mythplugins/mythbrowser/mythbrowser/main.cpp
15 15 #include "bookmarkmanager.h" 16 16 #include "browserdbutil.h" 17 17 #include "mythbrowser.h" 18 #include "mythflashplayer.h" 18 19 19 20 using namespace std; 20 21 … … 30 31 float zoom = gCoreContext->GetSetting("WebBrowserZoomLevel", "1.4").toFloat(); 31 32 32 33 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 34 MythScreenType *mythbrowser; 35 if (urls[0].startsWith("mythflash://")) 36 mythbrowser = new MythFlashPlayer(mainStack, urls); 37 else 38 mythbrowser = new MythBrowser(mainStack, urls, zoom); 33 39 34 MythBrowser *mythbrowser = new MythBrowser(mainStack, urls, zoom);35 36 40 if (mythbrowser->Create()) 37 41 mainStack->AddScreen(mythbrowser); 38 42 else -
mythplugins/mythbrowser/mythbrowser/mythflashplayer.cpp
1 #include <stdlib.h> 2 #include <iostream> 3 4 // qt 5 #include <QApplication> 6 #include <QEvent> 7 8 // myth 9 #include <mythverbose.h> 10 #include <mythcontext.h> 11 #include <libmythui/mythmainwindow.h> 12 #include <mythuiwebbrowser.h> 13 14 // mythbrowser 15 #include "webpage.h" 16 #include "mythflashplayer.h" 17 18 using namespace std; 19 20 MythFlashPlayer::MythFlashPlayer(MythScreenStack *parent, 21 QStringList &urlList) 22 : MythScreenType (parent, "mythflashplayer"), 23 m_browser(NULL), m_url(urlList[0]) 24 { 25 qApp->setOverrideCursor(QCursor(Qt::BlankCursor)); 26 } 27 28 29 MythFlashPlayer::~MythFlashPlayer() 30 { 31 qApp->restoreOverrideCursor(); 32 33 if (m_browser) 34 { 35 m_browser->disconnect(); 36 DeleteChild(m_browser); 37 m_browser = NULL; 38 } 39 } 40 41 bool MythFlashPlayer::Create(void) 42 { 43 m_browser = new MythUIWebBrowser(this, "mythflashplayer"); 44 m_browser->SetArea(GetMythMainWindow()->GetUIScreenRect()); 45 m_browser->Init(); 46 m_browser->SetActive(true); 47 m_browser->Show(); 48 49 BuildFocusList(); 50 51 SetFocusWidget(m_browser); 52 53 m_url.replace("mythflash://", "http://"); 54 VERBOSE(VB_GENERAL, QString("Opening %1").arg(m_url)); 55 m_browser->LoadPage(QUrl::fromEncoded(m_url.toLocal8Bit())); 56 57 return true; 58 } 59 60 QVariant MythFlashPlayer::evaluateJavaScript(const QString& source) 61 { 62 return m_browser->evaluateJavaScript(source); 63 } 64 65 bool MythFlashPlayer::keyPressEvent(QKeyEvent *event) 66 { 67 QStringList actions; 68 bool handled = GetMythMainWindow()->TranslateKeyPress("TV Playback", event, actions); 69 70 for (int i = 0; i < actions.size() && !handled; i++) 71 { 72 QString action = actions[i]; 73 handled = true; 74 75 if (action == "PAUSE") 76 evaluateJavaScript("play();"); 77 else if (action == "SEEKFFWD") 78 evaluateJavaScript("seek(10);"); 79 else if (action == "SEEKRWND") 80 evaluateJavaScript("seek(-10);"); 81 else if (action == "CHANNELUP") 82 evaluateJavaScript("seek(60);"); 83 else if (action == "CHANNELDOWN") 84 evaluateJavaScript("seek(-60);"); 85 else 86 handled = false; 87 88 if (handled) 89 return true; 90 } 91 92 handled = m_browser->keyPressEvent(event); 93 94 if (!handled && MythScreenType::keyPressEvent(event)) 95 handled = true; 96 97 return handled; 98 } -
mythtv/libs/libmythui/mythuiwebbrowser.h
72 72 bool CanGoForward(void); 73 73 bool CanGoBack(void); 74 74 75 QVariant evaluateJavaScript(const QString& scriptSource); 76 75 77 public slots: 76 78 void Back(void); 77 79 void Forward(void); -
mythtv/libs/libmythui/mythuiwebbrowser.cpp
322 322 { 323 323 if (m_browser) 324 324 { 325 m_browser->hide(); 325 326 m_browser->disconnect(); 326 327 m_browser->deleteLater(); 327 328 m_browser = NULL; … … 551 552 return QUrl(); 552 553 } 553 554 555 /** \fn MythUIWebBrowser::evaluateJavaScript(const QString& scriptSource) 556 * \brief Evaluates the JavaScript code in \a scriptSource. 557 * \return QVariant 558 */ 559 QVariant MythUIWebBrowser::evaluateJavaScript(const QString& scriptSource) 560 { 561 if (m_browser) 562 return m_browser->page()->mainFrame()->evaluateJavaScript(scriptSource); 563 else 564 return QVariant(); 565 } 566 554 567 void MythUIWebBrowser::slotLoadStarted(void) 555 568 { 556 569 emit loadStarted(); -
mythtv/bindings/python/MythTV/methodheap.py
995 995 find('InternetContent').findall('grabber'): 996 996 yield InternetSource.fromEtree(grabber, self) 997 997 998 def getInternetContentUrl(self, grabber, videocode): 999 return "mythflash://%s:%s/Myth/GetInternetContent?Grabber=%s&videocode=%s" \ 1000 % (self.host, self.port, grabber, videocode) 1001 998 1002 def getPreviewImage(self, chanid, starttime, width=None, \ 999 1003 height=None, secsin=None): 1000 1004 starttime = datetime.duck(starttime) -
mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/vimeo_api.py
61 61 import xml.etree.ElementTree as ET 62 62 import inspect 63 63 import oauth.oauth_api as oauth 64 from MythTV import MythXML 64 65 65 66 from vimeo_exceptions import (VimeoUrlError, VimeoHttpError, VimeoResponseError, VimeoVideoNotFound, VimeoRequestTokenError, VimeoAuthorizeTokenError, VimeoVideosSearchError, VimeoAllChannelError, __errmsgs__) 66 67 … … 669 670 670 671 """ 671 672 self.config = {} 673 self.mythxml = MythXML() 672 674 673 675 self.config['debug_enabled'] = debug # show debugging messages 674 676 … … 980 982 if url.get('type') == 'video': 981 983 if url.text: # Make the link fullscreen and auto play 982 984 if embed_flag: 983 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') 985 playerUrl = self.mythxml.getInternetContentUrl("nv_python_libs/configs/HTML/vimeo.html", \ 986 url.text.strip().replace(u'http://vimeo.com/', '')) 987 v_details[url.tag] = self.ampReplace(playerUrl) 984 988 else: 985 989 v_details[url.tag] = self.ampReplace(url.text.strip()) 986 990 else: -
mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/vimeo.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> 2 <html> 3 <head> 4 <style type="text/css"> 5 body { 6 padding: 0; 7 margin: 0; 8 } 9 </style> 10 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> 11 <script type="text/javascript"> 12 /* gup function by R.D. Vaughan */ 13 function gup( name ) 14 { 15 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 16 var regexS = "[\\?&]"+name+"=([^&#]*)"; 17 var regex = new RegExp( regexS ); 18 var results = regex.exec( window.location.href ); 19 if( results == null ) 20 return ""; 21 else 22 return results[1]; 23 } 24 25 var video_id = gup( 'videocode' ); 26 var myth_player = false; 27 var paused = false; 28 29 function vimeo_player_loaded(swf_id) { 30 myth_player = document.getElementById(swf_id); 31 document.getElementById('controls').style.display = ''; 32 } 33 34 function play() { 35 if (paused) { 36 myth_player.api_play(); 37 paused = false; 38 } 39 else if (!paused) { 40 myth_player.api_pause(); 41 paused = true; 42 } 43 } 44 45 function seek(amount) { 46 if (myth_player) { 47 myth_player.api_seekTo(myth_player.api_getCurrentTime() + amount); 48 } 49 } 50 51 var flashvars = { 52 clip_id: video_id, 53 show_portrait: 1, 54 show_byline: 1, 55 show_title: 1, 56 fp_version: 10, 57 js_api: 1, // required in order to use the Javascript API 58 js_onLoad: 'vimeo_player_loaded', // moogaloop will call this JS function when it's done loading (optional) 59 js_swf_id: 'myth_player' // this will be passed into all event methods so you can keep track of multiple moogaloops (optional) 60 }; 61 var params = { 62 allowscriptaccess: 'always', 63 allowfullscreen: 'true', 64 wmode: 'opaque', 65 66 }; 67 var attributes = {}; 68 69 // For more SWFObject documentation visit: http://code.google.com/p/swfobject/wiki/documentation 70 swfobject.embedSWF("http://vimeo.com/moogaloop.swf?autoplay=1", "myth_player", window.innerWidth, window.innerHeight, "9.0.0","expressInstall.swf", flashvars, params, attributes); 71 </script> 72 </head> 73 <body> 74 <div id="myth_player"/> 75 </body> 76 </html> -
mythtv/programs/scripts/internetcontent/nv_python_libs/youtube/youtube_api.py
38 38 import os, struct, sys, re, time 39 39 import urllib, urllib2 40 40 import logging 41 from MythTV import MythXML 41 42 42 43 try: 43 44 import xml.etree.cElementTree as ElementTree … … 148 149 149 150 """ 150 151 self.config = {} 152 self.mythxml = MythXML() 151 153 152 154 if apikey is not None: 153 155 self.config['apikey'] = apikey … … 522 524 continue 523 525 if not elem.get(key) == '5': 524 526 continue 525 item['video'] = self.ampReplace((elem.get('url')+'&autoplay=1')) 527 m = re.search("/v/([^?]+)", elem.get("url")) 528 if m: 529 url = self.mythxml.getInternetContentUrl("nv_python_libs/configs/HTML/youtube.html", \ 530 m.group(1)) 531 item['video'] = self.ampReplace(url) 532 else: 533 item['video'] = self.ampReplace((elem.get('url')+'&autoplay=1')) 526 534 flash = True 527 535 continue 528 536 if not item.has_key('video'): -
mythtv/programs/scripts/internetcontent/nv_python_libs/configs/HTML/youtube.html
1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> 2 2 <html> 3 <head> 4 <!-- Author: R.D. Vaughan 5 Apr 28th, 2010 6 Purpose: Implement full screen browser video display for the BBC iPlayer 7 Example: 8 file:///usr/local/share/mythtv/mythnetvision/scripts/nv_python_libs/configs/HTML/bbciplayer.html?videocode=b00s5nfv 9 --> 10 <script type="text/javascript"> 11 function gup( name ) 12 { 13 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 14 var regexS = "[\\?&]"+name+"=([^&#]*)"; 15 var regex = new RegExp( regexS ); 16 var results = regex.exec( window.location.href ); 17 if( results == null ) 18 return ""; 19 else 20 return results[1]; 21 } 3 <head> 4 <style type="text/css"> 5 body { 6 padding: 0; 7 margin: 0; 8 } 9 </style> 22 10 23 var videocode = gup( 'videocode' ); 24 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&rv.2.thumbnailUrl=http%3A%2F%2Fi2.ytimg.com%2Fvi%2FIFhhaXDziZ4%2Fdefault.jpg&rv.0.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBf04aUZMIVQ&rv.0.view_count=28868&vq=auto&rv.6.author=krlitosito&rv.3.view_count=34084&rv.0.length_seconds=251&rv.4.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FzI9C9j0QgU4%2Fdefault.jpg&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&csi_page_type=wwad&cr=CA&rv.1.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPzeRpPSZOjI&rv.6.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FBwBz4h_4POA%2Fdefault.jpg&host_language=en&rv.3.rating=4.92660550459&fmt_list=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&rv.7.id=P5y-yjheRKE&targeting_video_doc_id=&rv.0.rating=4.97297297297&invideo=True&rv.5.id=6oHEgkK9wj0&tk=Rqbx09U3FZ_vusI7vVWVX-zIbWbZAIm1Q2GN6gt7W3SQKWb-qm-Lvw%3D%3D&sffb=True&rv.0.id=Bf04aUZMIVQ&rv.5.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6oHEgkK9wj0&timestamp=1276178843&rv.0.author=WaspEnterprise&rv.3.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2F663CI_o4sTY%2Fdefault.jpg&rv.2.author=8Etech8&rv.6.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBwBz4h_4POA&ad_host=ca-host-pub-4790912793353039&ad_eurl=http%3A%2F%2Fwww.youtube.com%2Fvideo%2FVIDEOCODE&mpu=True&hl=en_US&ad_flags=1&rv.0.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2FBf04aUZMIVQ%2Fdefault.jpg&rv.5.length_seconds=282&rv.7.author=krlitosito&rv.5.view_count=7517&rv.1.length_seconds=251&rv.3.id=663CI_o4sTY&rv.2.id=IFhhaXDziZ4&rv.2.length_seconds=316&t=vjVQa1PpcFMjs5n51hkGar4Hp9uA3GYTt6LvegEYo00%3D&rv.6.id=BwBz4h_4POA&cafe_experiment_id=&rv.6.view_count=2565&rv.3.author=krlitosito&rv.4.id=zI9C9j0QgU4&fexp=902303%2C906712&allow_embed=1&ad_host_tier=54235&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&rv.2.rating=4.88311688312&shownextbutton=1&rv.1.id=PzeRpPSZOjI&rv.4.length_seconds=228&ad_logging_flag=1&rv.7.view_count=3940&rv.6.length_seconds=253&length_seconds=295&fmt_map=34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0&enablejsapi=1&video_id=VIDEOCODE&plid=AASIrYqnNA1liVSJ&afv=True&rv.5.rating=4.98&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&ad_video_pub_id=ca-pub-6219811747049371&rv.4.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzI9C9j0QgU4&rv.1.author=0rganix&rv.1.rating=4.97674418605&rv.5.thumbnailUrl=http%3A%2F%2Fi3.ytimg.com%2Fvi%2F6oHEgkK9wj0%2Fdefault.jpg&watermark=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf&rv.7.rating=4.73333333333&rv.3.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D663CI_o4sTY&rv.2.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIFhhaXDziZ4&cid=6&rv.7.url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DP5y-yjheRKE&rv.2.view_count=31320&ad_channel_code_overlay=invideo_overlay_480x70_cat10%2Cafv_overlay%2Cafv_ugc%2Cytps_default%2Cyt_mpvid_AASIrYqpBw0C8F4n%2Cyt_cid_6%2Cytexp_902303.906712&rv.4.view_count=1325763&ad_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fad-vfl170492.swf&rv.1.view_count=22657&dclk=True&rv.6.rating=5.0&sk=lsWSaZl1UFLCUxUw44Lon-hoi_2GTCy-C&ctb=True&rv.1.thumbnailUrl=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FPzeRpPSZOjI%2Fdefault.jpg&mpvid=AASIrYqpBw0C8F4n&rv.3.length_seconds=330&rv.5.author=Ulrick31&rv.4.rating=4.90052939537" allowscriptaccess="always" allowfullscreen="true" bgcolor="#000000" />'; 25 document.write('<title>YouTube Full Screen</title>'); 26 document.write(embedded.replace(/VIDEOCODE/g, videocode)); 11 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> 12 <script type="text/javascript"> 13 /* gup function by R.D. Vaughan */ 14 function gup( name ) 15 { 16 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 17 var regexS = "[\\?&]"+name+"=([^&#]*)"; 18 var regex = new RegExp( regexS ); 19 var results = regex.exec( window.location.href ); 20 if( results == null ) 21 return ""; 22 else 23 return results[1]; 24 } 27 25 28 </script> 29 </head> 26 var myth_player = null; 27 28 var params = { 29 allowScriptAccess: "always", 30 allowfullscreen: 'true', 31 wmode: 'opaque' 32 }; 33 var atts = { id: "myytplayer" }; 34 swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=ytplayer", 35 "myth_player", window.innerWidth, window.innerHeight, "8", null, null, params, atts); 36 37 function onYouTubePlayerReady(playerId) { 38 myth_player = document.getElementById("myytplayer"); 39 var videocode = gup('videocode'); 40 if (videocode != "") { 41 myth_player.cueVideoById(videocode); 42 myth_player.playVideo(); 43 } 44 } 45 46 function play() { 47 if (myth_player) { 48 var state = myth_player.getPlayerState(); 49 if (state == 1) // Playing 50 myth_player.pauseVideo(); 51 else if (state != 3) // Video is either unstarted, ended, paused or cued 52 myth_player.playVideo(); 53 } 54 } 55 56 function seek(amount) { 57 if (myth_player) { 58 myth_player.seekTo(myth_player.getCurrentTime() + amount, true); 59 } 60 } 61 62 window.onresize = function() { 63 document.body.style.width = window.innerWidth; 64 document.body.style.height = window.innerHeight; 65 if (myth_player) { 66 // myth_player.setSize(window.innerWidth, window.innerHeight); 67 document.getElementById("myytplayer").width = window.innerWidth; 68 document.getElementById("myytplayer").height = window.innerHeight; 69 } 70 }; 71 </script> 72 </head> 73 <body> 74 <div id="myth_player"/> 75 </body> 30 76 </html>