Permalink
Browse files

Fix: All media URLs converted to absolute. Fixes Flash m4a/m4v relati…

…ve url issue.
  • Loading branch information...
1 parent 3489b17 commit 8abab8f55bc107adec6d1991538c20cad30ebff2 @thepag thepag committed Oct 31, 2013
Showing with 26 additions and 7 deletions.
  1. +1 −1 jplayer.jquery.json
  2. +24 −5 jquery.jplayer/jquery.jplayer.js
  3. +1 −1 package.json
View
@@ -11,7 +11,7 @@
"html5",
"streaming"
],
- "version": "2.4.1",
+ "version": "2.4.2",
"author": {
"name": "Mark J Panaghiston",
"url": "http://happyworm.com/"
@@ -7,8 +7,8 @@
* http://opensource.org/licenses/MIT
*
* Author: Mark J Panaghiston
- * Version: 2.4.1
- * Date: 21st June 2013
+ * Version: 2.4.2
+ * Date: 31st October 2013
*/
/* Code verified using http://www.jshint.com/ */
@@ -468,7 +468,7 @@
$.jPlayer.prototype = {
count: 0, // Static Variable: Change it via prototype.
version: { // Static Object
- script: "2.4.1",
+ script: "2.4.2",
needFlash: "2.4.1",
flash: "unknown"
},
@@ -1582,12 +1582,28 @@
this.html.active = false;
this.flash.active = false;
},
+ _escapeHtml: function(s) {
+ return s.split('&').join('&amp;').split('<').join('&lt;').split('>').join('&gt;').split('"').join('&quot;');
+ },
+ _qualifyURL: function(url) {
+ var el = document.createElement('div');
+ el.innerHTML= '<a href="' + this._escapeHtml(url) + '">x</a>';
+ return el.firstChild.href;
+ },
+ _absoluteMediaUrls: function(media) {
+ var self = this;
+ $.each(media, function(type, url) {
+ if(self.format[type]) {
+ media[type] = self._qualifyURL(url);
+ }
+ });
+ return media;
+ },
setMedia: function(media) {
/* media[format] = String: URL of format. Must contain all of the supplied option's video or audio formats.
* media.poster = String: Video poster URL.
- * media.subtitles = String: * NOT IMPLEMENTED * URL of subtitles SRT file
- * media.chapters = String: * NOT IMPLEMENTED * URL of chapters SRT file
+ * media.track = Array: Of objects defining the track element: kind, src, srclang, label, def.
* media.stream = Boolean: * NOT IMPLEMENTED * Designating actual media streams. ie., "false/undefined" for files. Plan to refresh the flash every so often.
*/
@@ -1599,6 +1615,9 @@
this._resetGate();
this._resetActive();
+ // Convert all media URLs to absolute URLs.
+ media = this._absoluteMediaUrls(media);
+
$.each(this.formats, function(formatPriority, format) {
var isVideo = self.format[format].media === 'video';
$.each(self.solutions, function(solutionPriority, solution) {
View
@@ -1,6 +1,6 @@
{
"name": "jplayer",
- "version": "2.4.1",
+ "version": "2.4.2",
"description": "The jQuery HTML5 Audio / Video Library",
"homepage": "http://www.jplayer.org/",
"keywords": [

0 comments on commit 8abab8f

Please sign in to comment.