diff --git a/dashboard-ui/cordova/android/androidcredentials.js b/dashboard-ui/cordova/android/androidcredentials.js index 6b3decf4ef..8c4233a24c 100644 --- a/dashboard-ui/cordova/android/androidcredentials.js +++ b/dashboard-ui/cordova/android/androidcredentials.js @@ -26,6 +26,109 @@ var capabilities = ConnectionManager.capabilities(); ApiClientBridge.init(AppInfo.appName, AppInfo.appVersion, AppInfo.deviceId, AppInfo.deviceName, JSON.stringify(capabilities)); + + initAjax(); + } + + var baseAjaxMethod; + var currentId = 0; + function getNewRequestId() { + var id = currentId++; + return id.toString(); + } + function initAjax() { + baseAjaxMethod = HttpClient.send; + HttpClient.send = sendRequest; + } + + function sendRequest(request) { + + // For now, we can only handle json responses + if (request.dataType) { + if (request.dataType != 'json') { + return baseAjaxMethod(request); + } + } + + if (request.data) { + // For now, we can only handle request bodies that are strings + if (typeof (request.data) != 'string') { + return baseAjaxMethod(request); + } + } + + var deferred = DeferredBuilder.Deferred(); + + var id = getNewRequestId(); + + request.headers = request.headers || {}; + + if (request.dataType == 'json') { + request.headers.accept = 'application/json'; + } + + var method = request.type || "GET"; + + var javaRequest = { + Method: method, + Url: request.url, + RequestHeaders: request.headers + }; + + if (request.timeout) { + javaRequest.Timeout = request.timeout; + } + + if (request.data) { + javaRequest.RequestContent = request.data; + } + + if (request.contentType) { + javaRequest.RequestContentType = request.contentType; + } + + //Logger.log("Sending request: " + JSON.stringify(javaRequest)); + + ApiClientBridge.sendRequest(JSON.stringify(javaRequest), request.dataType, id); + + Events.on(AndroidAjax, 'response' + id, function (e, isSuccess, response) { + + Events.off(AndroidAjax, 'response' + id); + + if (isSuccess) { + + if (response) { + deferred.resolveWith(null, [response]); + } else { + deferred.resolve(); + } + } + else { + + // Need to mimic the jquery ajax error response + deferred.rejectWith(request, [getErrorResponse(response)]); + } + + }); + + return deferred.promise(); + } + + function getErrorResponse(response) { + + var error = {}; + + if (response.StatusCode) { + error.status = response.StatusCode; + } + + error.ResponseHeaders = response.ResponseHeaders || {}; + + error.getResponseHeader = function (name) { + return error.ResponseHeaders[name]; + }; + + return error; } function getDownloadSpeed(bytes, url) { @@ -78,6 +181,14 @@ window.AndroidAjax = { + onResponse: function (id, response) { + + Events.trigger(AndroidAjax, 'response' + id, [true, response]); + }, + onError: function (id, response) { + + Events.trigger(AndroidAjax, 'response' + id, [false, response]); + }, onDownloadSpeedResponse: function (response) { Events.trigger(AndroidAjax, 'downloadspeedresponse', [response]); diff --git a/dashboard-ui/cordova/imagestore.js b/dashboard-ui/cordova/imagestore.js index f93c7e9b24..5e167bfda7 100644 --- a/dashboard-ui/cordova/imagestore.js +++ b/dashboard-ui/cordova/imagestore.js @@ -71,14 +71,14 @@ var deferred = DeferredBuilder.Deferred(); var key = getCacheKey(originalUrl); - Logger.log('getImageUrl:' + originalUrl); + //Logger.log('getImageUrl:' + originalUrl); getFileSystem().done(function (fileSystem) { var path = fileSystem.root.toURL() + "/emby/cache/" + key; resolveLocalFileSystemURL(path, function (fileEntry) { var localUrl = normalizeReturnUrl(fileEntry.toURL()); - Logger.log('returning cached file: ' + localUrl); + //Logger.log('returning cached file: ' + localUrl); deferred.resolveWith(null, [localUrl]); }, function () { diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 4822edef9b..df01115705 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -527,15 +527,13 @@ minScale: 2 }); + personHtml += '
'; } else { imgUrl = "css/images/items/list/person.png"; + personHtml += '
'; } - personHtml += '
'; - - - personHtml += '
'; personHtml += '

' + cast.Name + '

'; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 18c438ad00..23ff250e0d 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -438,26 +438,26 @@ Format: 'srt', Method: 'Embed' }); - profile.SubtitleProfiles.push({ - Format: 'ass', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'ssa', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'pgs', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'pgssub', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'dvdsub', - Method: 'Embed' - }); + //profile.SubtitleProfiles.push({ + // Format: 'ass', + // Method: 'Embed' + //}); + //profile.SubtitleProfiles.push({ + // Format: 'ssa', + // Method: 'Embed' + //}); + //profile.SubtitleProfiles.push({ + // Format: 'pgs', + // Method: 'Embed' + //}); + //profile.SubtitleProfiles.push({ + // Format: 'pgssub', + // Method: 'Embed' + //}); + //profile.SubtitleProfiles.push({ + // Format: 'dvdsub', + // Method: 'Embed' + //}); profile.SubtitleProfiles.push({ Format: 'vtt', Method: 'Embed' diff --git a/dashboard-ui/strings/html/server.json b/dashboard-ui/strings/html/server.json index 31cf2677f0..977ef60651 100644 --- a/dashboard-ui/strings/html/server.json +++ b/dashboard-ui/strings/html/server.json @@ -1426,8 +1426,8 @@ "OptionAllowVideoPlaybackTranscoding": "Allow video playback that requires transcoding", "OptionAllowMediaPlaybackTranscodingHelp": "Users will receive friendly messages when content is unplayable based on policy.", "TabStreaming": "Streaming", - "LabelRemoteClientBitrateLimit": "Remote client bitrate limit (Mbps):", - "LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all remote clients. This is useful to prevent clients from requesting a higher bitrate than your connection can handle.", + "LabelRemoteClientBitrateLimit": "Internet streaming bitrate limit (Mbps):", + "LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all out of network clients. This is useful to prevent clients from requesting a higher bitrate than your internet connection can handle.", "LabelConversionCpuCoreLimit": "CPU core limit:", "LabelConversionCpuCoreLimitHelp": "Limit the number of CPU cores that will be used during sync conversion.", "OptionEnableFullSpeedConversion": "Enable full speed conversion", diff --git a/packages.config b/packages.config index 48f68789ba..cb5a323478 100644 --- a/packages.config +++ b/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file