|
7 | 7 | * http://opensource.org/licenses/MIT
|
8 | 8 | *
|
9 | 9 | * Author: Mark J Panaghiston
|
10 |
| - * Version: 2.4.1 |
11 |
| - * Date: 21st June 2013 |
| 10 | + * Version: 2.4.2 |
| 11 | + * Date: 31st October 2013 |
12 | 12 | */
|
13 | 13 |
|
14 | 14 | /* Code verified using http://www.jshint.com/ */
|
|
468 | 468 | $.jPlayer.prototype = {
|
469 | 469 | count: 0, // Static Variable: Change it via prototype.
|
470 | 470 | version: { // Static Object
|
471 |
| - script: "2.4.1", |
| 471 | + script: "2.4.2", |
472 | 472 | needFlash: "2.4.1",
|
473 | 473 | flash: "unknown"
|
474 | 474 | },
|
|
1582 | 1582 | this.html.active = false;
|
1583 | 1583 | this.flash.active = false;
|
1584 | 1584 | },
|
| 1585 | + _escapeHtml: function(s) { |
| 1586 | + return s.split('&').join('&').split('<').join('<').split('>').join('>').split('"').join('"'); |
| 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 | + }, |
1585 | 1602 | setMedia: function(media) {
|
1586 | 1603 |
|
1587 | 1604 | /* media[format] = String: URL of format. Must contain all of the supplied option's video or audio formats.
|
1588 | 1605 | * 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. |
1591 | 1607 | * media.stream = Boolean: * NOT IMPLEMENTED * Designating actual media streams. ie., "false/undefined" for files. Plan to refresh the flash every so often.
|
1592 | 1608 | */
|
1593 | 1609 |
|
|
1599 | 1615 | this._resetGate();
|
1600 | 1616 | this._resetActive();
|
1601 | 1617 |
|
| 1618 | + // Convert all media URLs to absolute URLs. |
| 1619 | + media = this._absoluteMediaUrls(media); |
| 1620 | + |
1602 | 1621 | $.each(this.formats, function(formatPriority, format) {
|
1603 | 1622 | var isVideo = self.format[format].media === 'video';
|
1604 | 1623 | $.each(self.solutions, function(solutionPriority, solution) {
|
|
0 commit comments