1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

remove <br/> from parsed subtitles

This commit is contained in:
Luke Pulverenti 2014-06-13 10:24:14 -04:00
parent 462766c0db
commit 53c6887c71
3 changed files with 46 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

View file

@ -42,7 +42,14 @@
}; };
self.getCurrentTicks = function (mediaElement) { self.getCurrentTicks = function (mediaElement) {
return Math.floor(10000000 * (mediaElement || currentMediaElement).currentTime) + self.startTimeTicksOffset;
var playerTime = Math.floor(10000000 * (mediaElement || currentMediaElement).currentTime);
//if (currentItem.MediaType == 'Audio') {
playerTime += self.startTimeTicksOffset;
//}
return playerTime;
}; };
self.clearPauseStop = function () { self.clearPauseStop = function () {
@ -218,6 +225,8 @@
$(self).trigger('positionchange', [state]); $(self).trigger('positionchange', [state]);
}; };
var supportsTextTracks;
self.supportsTextTracks = function () { self.supportsTextTracks = function () {
// Does not support changing tracks via mode property // Does not support changing tracks via mode property
@ -225,8 +234,13 @@
return false; return false;
} }
// For now, until perfected if (supportsTextTracks == null) {
return false;
supportsTextTracks = document.createElement('video').textTracks != null;
}
// For now, until ready
return supportsTextTracks;
}; };
self.canPlayVideoDirect = function (mediaSource, videoStream, audioStream, subtitleStream, maxWidth, bitrate) { self.canPlayVideoDirect = function (mediaSource, videoStream, audioStream, subtitleStream, maxWidth, bitrate) {

View file

@ -2,8 +2,34 @@
window.MediaBrowser = {}; window.MediaBrowser = {};
} }
MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, window, FileReader) { MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, window, FileReader, localStorage) {
function generateDeviceId() {
var keys = [];
keys.push(navigator.userAgent);
keys.push((navigator.cpuClass || ""));
var randomId = '';
if (localStorage) {
// Since the above is not guaranteed to be unique per device, add a little more
randomId = localStorage.getItem('randomId');
if (!randomId) {
randomId = new Date().getTime();
localStorage.setItem('randomId', randomId);
}
}
keys.push(randomId);
return MediaBrowser.SHA1(keys.join('|'));
}
/** /**
* Creates a new api client instance * Creates a new api client instance
* @param {String} serverAddress * @param {String} serverAddress
@ -18,7 +44,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
var self = this; var self = this;
var deviceName = "Web Browser"; var deviceName = "Web Browser";
var deviceId = MediaBrowser.SHA1(navigator.userAgent + (navigator.cpuClass || "")); var deviceId = generateDeviceId();
var currentUserId; var currentUserId;
var webSocket; var webSocket;
@ -3155,7 +3181,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
}; };
}(jQuery, navigator, window.JSON, window.WebSocket, setTimeout, window, window.FileReader); }(jQuery, navigator, window.JSON, window.WebSocket, setTimeout, window, window.FileReader, window.localStorage);
/** /**
* Provides a friendly way to create an api client instance using information from the browser's current url * Provides a friendly way to create an api client instance using information from the browser's current url