Skip to content

Instantly share code, notes, and snippets.

@erikvold
Created September 3, 2009 13:41
Show Gist options
  • Save erikvold/180299 to your computer and use it in GitHub Desktop.
Save erikvold/180299 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Temporary Video Fix for Charlierose.com
// @author Erik Vold
// @namespace charlieroseTempVideoFix
// @include http://www.charlierose.com/view/interview/*
// @version 0.1
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @datecreated 2009-08-28
// @lastupdated 2009-08-29
// @description
// ==/UserScript==
var videoMsgEM = document.evaluate("//div[@id='video-meta']/dl/dd/p/em[text()='Video can temporarily be seen by clicking ']", document, null, 9, null).singleNodeValue;
var videoURL = videoMsgEM.nextSibling.href;
var playBtn = document.getElementById('embedded_static_image');
if( playBtn ) {
//var postImg = playBtn.previousSibling.src;
var newBtn = document.createElement( "a" );
newBtn.id = "embedded_static_image";
newBtn.href = "#";
newBtn.innerHTML = "play";
newBtn.addEventListener( "click", function() {
unsafeWindow.$("#flash_container").html( '<video poster="' + "http://www.charlierose.com/images/assets/flashplayer.jpg" + '" src="' + videoURL + '" width="460" height="360" controls="true" autobuffer="true" autoplay="false" />' );
}, false );
playBtn.parentNode.replaceChild( newBtn, playBtn );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment