From 08e2bd6efb91b949fe309e8f5ec9c6766fe8cb04 Mon Sep 17 00:00:00 2001
From: Seth Meranda <smeranda2@unl.edu>
Date: Thu, 22 Sep 2011 17:10:40 +0000
Subject: [PATCH] Fix the mediaelement to work on the video, simply swapped out
 old code with embed option from mediahub.

---
 index.php      | 14 ++++++++++++--
 js/gobigred.js | 41 -----------------------------------------
 2 files changed, 12 insertions(+), 43 deletions(-)

diff --git a/index.php b/index.php
index c287dc2..c92b744 100644
--- a/index.php
+++ b/index.php
@@ -73,8 +73,18 @@
 				</div>
 			</li>
 			<li id="slide_video">
-                           <video src="http://www.unl.edu/ucomm/ucomm/av/video/gobigred/20110915_Ucomm_TV.mp4" poster="images/videoThumbnail.jpg" controls></video>       
-                           <div>
+                           <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
+							<video height="309" width="549" autoplay src="http://www.unl.edu/ucomm/ucomm/av/video/gobigred/20110915_Ucomm_TV.mp4" controls poster="http://itunes.unl.edu/thumbnails.php?url=http%3A%2F%2Fwww.unl.edu%2Fucomm%2Fucomm%2Fav%2Fvideo%2Fgobigred%2F20110915_Ucomm_TV.mp4">
+								<track src="http://mediahub.unl.edu/media/2411/vtt" kind="subtitles" type="text/vtt" srclang="en" />
+							</video>
+							<script type="text/javascript">
+								if (typeof(WDN) === "undefined") {
+									if (typeof(jQuery) === "undefined"){var j=document.createElement("script"); j.setAttribute("type","text/javascript"); j.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"); document.getElementsByTagName("head")[0].appendChild(j);}
+								} else {jQuery = WDN.jQuery;}
+								var c=document.createElement("link"); c.setAttribute("type", "text/css"); c.setAttribute("rel", "stylesheet"); c.setAttribute("href", "http://www.unl.edu/wdn/templates_3.0/css/content/mediaelement.css"); document.getElementsByTagName("head")[0].appendChild(c);
+								window.onload=function(){jQuery.getScript('http://www.unl.edu/wdn/templates_3.0/scripts/mediaelement.js', function(){jQuery('video,audio').mediaelementplayer();});};
+							</script>
+                            <div>
                                 <h3>Big Red in the Big Ten</h3>
                                 <p>UNL's entry to the <a href="http://www.unl.edu/ucomm/aboutunl/big10.shtml" title="read more about the Big Ten Conference and CIC">Big Ten and the CIC</a> means exciting new opportunities for students and research ... and it's just the beginning.</p>
                            </div>
diff --git a/js/gobigred.js b/js/gobigred.js
index 7f1fddb..5e0780a 100644
--- a/js/gobigred.js
+++ b/js/gobigred.js
@@ -55,47 +55,6 @@ WDN.jQuery(document).ready(function() {
 	});
 });
 
-WDN.jQuery(function(){
-	var uri = window.location.href.split('#');
-	sliderStart = 0;
-	if (!isNaN(parseInt(uri[1] *1))) {
-		sliderStart = uri[1] - 1;
-	}
-    jQuery = WDN.jQuery;
-    var forcePlay = false;
-    WDN.jQuery('#bigTenVideo').click(function() {
-    	WDN.jQuery('.wdn_carousel').addClass('full');
-    	forcePlay = true;
-    });
-    WDN.jQuery.getScript('http://www.unl.edu/wdn/templates_3.0/scripts/mediaelement.js', 
-    function(){
-        WDN.jQuery('#bigTenVideo video').mediaelementplayer({
-            features: ['playpause','progress','current','duration','tracks','volume'],
-            pluginPath: '/wdn/templates_3.0/scripts/',
-            success: function(mediaElement, domObject) {
-            	if (forcePlay) {
-            		mediaElement.play();
-            	}
-            	var slideTimeout;
-            	var videoUIToggle = function() {
-            		if (slideTimeout) {
-            			window.clearTimeout(slideTimeout);
-            		}
-                    WDN.jQuery('.wdn_carousel').addClass('full');
-                    mediaElement.play();
-                    WDN.jQuery(this).unbind('click');
-            	};
-                WDN.jQuery('#bigTenVideo').unbind('click').click(videoUIToggle);
-                mediaElement.addEventListener('ended', function(){
-                    WDN.jQuery('.wdn_carousel').removeClass('full');
-                	WDN.jQuery('#bigTenVideo').unbind('click').click(videoUIToggle);
-                    slideTimeout = window.setTimeout(function(){WDN.jQuery('.currentScroller').trigger('start')}, 5000);
-                });
-            }
-        });
-    }); 
-});
-
 function formatBlogDate(theDate) {
 	splitDates = theDate.split(" ");
 	//theDate = "<span class=\"month\">" + splitDates[2] + "</span> <span class=\"day\">" + splitDates[1] + "</span>";
-- 
GitLab