Skip to content

Commit 8abab8f

Browse files
committed
Fix: All media URLs converted to absolute. Fixes Flash m4a/m4v relative url issue.
1 parent 3489b17 commit 8abab8f

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

jplayer.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"html5",
1212
"streaming"
1313
],
14-
"version": "2.4.1",
14+
"version": "2.4.2",
1515
"author": {
1616
"name": "Mark J Panaghiston",
1717
"url": "http://happyworm.com/"

jquery.jplayer/jquery.jplayer.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* http://opensource.org/licenses/MIT
88
*
99
* Author: Mark J Panaghiston
10-
* Version: 2.4.1
11-
* Date: 21st June 2013
10+
* Version: 2.4.2
11+
* Date: 31st October 2013
1212
*/
1313

1414
/* Code verified using http://www.jshint.com/ */
@@ -468,7 +468,7 @@
468468
$.jPlayer.prototype = {
469469
count: 0, // Static Variable: Change it via prototype.
470470
version: { // Static Object
471-
script: "2.4.1",
471+
script: "2.4.2",
472472
needFlash: "2.4.1",
473473
flash: "unknown"
474474
},
@@ -1582,12 +1582,28 @@
15821582
this.html.active = false;
15831583
this.flash.active = false;
15841584
},
1585+
_escapeHtml: function(s) {
1586+
return s.split('&').join('&amp;').split('<').join('&lt;').split('>').join('&gt;').split('"').join('&quot;');
1587+
},
1588+
_qualifyURL: function(url) {
1589+
var el = document.createElement('div');
1590+
el.innerHTML= '<a href="' + this._escapeHtml(url) + '">x</a>';
1591+
return el.firstChild.href;
1592+
},
1593+
_absoluteMediaUrls: function(media) {
1594+
var self = this;
1595+
$.each(media, function(type, url) {
1596+
if(self.format[type]) {
1597+
media[type] = self._qualifyURL(url);
1598+
}
1599+
});
1600+
return media;
1601+
},
15851602
setMedia: function(media) {
15861603

15871604
/* media[format] = String: URL of format. Must contain all of the supplied option's video or audio formats.
15881605
* media.poster = String: Video poster URL.
1589-
* media.subtitles = String: * NOT IMPLEMENTED * URL of subtitles SRT file
1590-
* media.chapters = String: * NOT IMPLEMENTED * URL of chapters SRT file
1606+
* media.track = Array: Of objects defining the track element: kind, src, srclang, label, def.
15911607
* media.stream = Boolean: * NOT IMPLEMENTED * Designating actual media streams. ie., "false/undefined" for files. Plan to refresh the flash every so often.
15921608
*/
15931609

@@ -1599,6 +1615,9 @@
15991615
this._resetGate();
16001616
this._resetActive();
16011617

1618+
// Convert all media URLs to absolute URLs.
1619+
media = this._absoluteMediaUrls(media);
1620+
16021621
$.each(this.formats, function(formatPriority, format) {
16031622
var isVideo = self.format[format].media === 'video';
16041623
$.each(self.solutions, function(solutionPriority, solution) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jplayer",
3-
"version": "2.4.1",
3+
"version": "2.4.2",
44
"description": "The jQuery HTML5 Audio / Video Library",
55
"homepage": "http://www.jplayer.org/",
66
"keywords": [

0 commit comments

Comments
 (0)