Permalink
Browse files

Merge pull request #310 from kabel/review-304

Further Work on #306
  • Loading branch information...
2 parents 1bbe9d9 + c8aac79 commit 634ee51aa3479779e3339e08be427dc186a6425b @kabel kabel committed Jun 25, 2012
@@ -1,6 +1,4 @@
-<audio id='player' preload="auto" src="http://elkhorn.unl.edu/citmp3/current/ogg2.mp3"></audio>
+<audio class='wdn_player' preload="auto" src="http://elkhorn.unl.edu/citmp3/current/ogg2.mp3"></audio>
<script type="text/javascript">
-WDN.initializePlugin('mediaelement_wdn', [function() {
- WDN.jQuery('#player').mediaelementplayer();
-}]);
+WDN.initializePlugin('mediaelement_wdn');
</script>
@@ -1,8 +1,10 @@
-<video id='player' height="540" width="960" autoplay src="http://ucomm.unl.edu/av/video/pyotm/PutYourselfOnTheMap.mp4" controls poster="http://itunes.unl.edu/thumbnails.php?url=http%3A%2F%2Fucomm.unl.edu%2Fav%2Fvideo%2Fpyotm%2FPutYourselfOnTheMap.mp4">
- <track src="http://mediahub.unl.edu/media/1018/vtt" kind="subtitles" type="text/vtt" srclang="en" />
-</video>
+<div class="grid6 first">
+ <video class="wdn_player" src="http://ucomm.unl.edu/av/video/pyotm/PutYourselfOnTheMap.mp4" controls poster="http://itunes.unl.edu/thumbnails.php?url=http%3A%2F%2Fucomm.unl.edu%2Fav%2Fvideo%2Fpyotm%2FPutYourselfOnTheMap.mp4"></video>
+</div>
+<div class="grid6">
+ <video class="wdn_player" src="http://mediahub.unl.edu/uploads/37bf38ddb70d3a2c460c166b5120269e.mp4" controls poster="http://itunes.unl.edu/thumbnails.php?url=http://mediahub.unl.edu/uploads/37bf38ddb70d3a2c460c166b5120269e.mp4"></video>
+</div>
<script type="text/javascript">
-WDN.initializePlugin('mediaelement_wdn', [function() {
- WDN.jQuery('#player').mediaelementplayer();
-}]);
+WDN.initializePlugin('mediaelement_wdn');
</script>
+
@@ -22,14 +22,14 @@
font-size: 77%;
line-height: 140%;
color: #333;
-
+
&:after {
content: "";
display: block;
clear: both;
height: 0;
}
-
+
a {
outline: none;
color: @colorPrimary;
@@ -41,44 +41,44 @@
color: #cc0000;
}
}
-
+
p {
margin: 0 0 1.1em 0;
}
-
+
img {
border: none;
}
-
+
ul, ol {
list-style: disc;
padding: 0 0 1.1em 1.5em;
}
-
+
ol {
list-style: decimal;
}
-
+
dd {
padding: 0 0 0 1.6em;
}
-
+
pre {
overflow: auto;
}
-
+
.clear {
clear: both;
}
-
- img, video, audio, object {
- max-width:100%;
+
+ img, video, audio {
+ max-width: 100%;
height: auto;
}
}
@media (min-width: 320px) {
-
+
}
@media (min-width: 480px) {
@@ -100,5 +100,4 @@
#wdn_content_wrapper {
padding: 0;
}
-
}
@@ -5,9 +5,26 @@
WDN.mediaelement_wdn = function() {
return {
initialize : function(callback) {
- WDN.loadCSS(WDN.getTemplateFilePath('scripts/plugins/mediaelement/css/mediaelementplayer.css'));
+ var min = '', body = document.getElementsByTagName('body');
+ if (!body.length || !body[0].className.match(/(^|\s)debug(\s|$)/)) {
+ min = '.min';
+ }
+
+ WDN.loadCSS(WDN.getTemplateFilePath('scripts/plugins/mediaelement/css/mediaelementplayer' + min + '.css'));
WDN.loadJQuery(function() {
- WDN.loadJS(WDN.getTemplateFilePath('scripts/plugins/mediaelement/mediaelement-and-player.min.js'), callback);
+ WDN.loadJS(WDN.getTemplateFilePath('scripts/plugins/mediaelement/mediaelement-and-player' + min + '.js'), function() {
+ WDN.jQuery('video.wdn_player, audio.wdn_player').each(function() {
+ WDN.jQuery(this).mediaelementplayer({
+ videoWidth: '100%',
+ videoHeight: '100%',
+ audioWidth: '100%'
+ });
+ });
+
+ if (callback) {
+ callback();
+ }
+ });
});
}
};
@@ -0,0 +1,16 @@
+Changes made to mediaelement-and-player.js
+
+* wrap the entire thing in an anonymous function to use WDN.jQuery
+ var mejs = mejs || {};
+ (function(mejs, jQuery) {
+ //code
+ })(mejs, WDN.jQuery);
+
+* converted height/width float to int
+
+ See: https://github.com/johndyer/mediaelement/commit/99c372549aa3b314ab312927a4f9db2485494b04#src/js/mep-player.js-P74
+
+ // START UNL CHANGE: all browsers appear to need this
+ t.width = parseInt(width, 10);
+ t.height = parseInt(height, 10);
+ // END UNL CHANGE
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Oops, something went wrong.

0 comments on commit 634ee51

Please sign in to comment.