mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update web components
This commit is contained in:
parent
909402537a
commit
fcdd2e4f4b
114 changed files with 1611 additions and 1238 deletions
|
@ -11,19 +11,19 @@
|
||||||
"license": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript/blob/master/LICENSE",
|
"license": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript/blob/master/LICENSE",
|
||||||
"homepage": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript",
|
"homepage": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cryptojslib": "cryptojslib#^3.1.2"
|
"cryptojslib": "cryptojslib#^3.1.2",
|
||||||
|
"requirejs": "requirejs#^2.1.22"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.0.3",
|
"version": "1.0.16",
|
||||||
"_release": "1.0.3",
|
"_release": "1.0.16",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.0.3",
|
"tag": "1.0.16",
|
||||||
"commit": "8e6266950e05e2d032d62340cb7307a3d19a23ec"
|
"commit": "a454b78f6e617aef9359736c57f38ac40fcc8d61"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
"_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
||||||
"_target": "~1.0.3",
|
"_target": "~1.0.3",
|
||||||
"_originalSource": "emby-apiclient",
|
"_originalSource": "emby-apiclient"
|
||||||
"_direct": true
|
|
||||||
}
|
}
|
|
@ -1,8 +1,4 @@
|
||||||
(function (globalScope, JSON, WebSocket, setTimeout, devicePixelRatio, FileReader) {
|
define(['events'], function (Events) {
|
||||||
|
|
||||||
if (!globalScope.MediaBrowser) {
|
|
||||||
globalScope.MediaBrowser = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new api client instance
|
* Creates a new api client instance
|
||||||
|
@ -10,17 +6,17 @@
|
||||||
* @param {String} clientName s
|
* @param {String} clientName s
|
||||||
* @param {String} applicationVersion
|
* @param {String} applicationVersion
|
||||||
*/
|
*/
|
||||||
globalScope.MediaBrowser.ApiClient = function (logger, serverAddress, clientName, applicationVersion, deviceName, deviceId) {
|
return function (serverAddress, clientName, applicationVersion, deviceName, deviceId, devicePixelRatio) {
|
||||||
|
|
||||||
if (!serverAddress) {
|
if (!serverAddress) {
|
||||||
throw new Error("Must supply a serverAddress");
|
throw new Error("Must supply a serverAddress");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log('ApiClient serverAddress: ' + serverAddress);
|
console.log('ApiClient serverAddress: ' + serverAddress);
|
||||||
logger.log('ApiClient clientName: ' + clientName);
|
console.log('ApiClient clientName: ' + clientName);
|
||||||
logger.log('ApiClient applicationVersion: ' + applicationVersion);
|
console.log('ApiClient applicationVersion: ' + applicationVersion);
|
||||||
logger.log('ApiClient deviceName: ' + deviceName);
|
console.log('ApiClient deviceName: ' + deviceName);
|
||||||
logger.log('ApiClient deviceId: ' + deviceId);
|
console.log('ApiClient deviceId: ' + deviceId);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var webSocket;
|
var webSocket;
|
||||||
|
@ -267,7 +263,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.enableAutomaticNetworking === false || request.type != "GET") {
|
if (self.enableAutomaticNetworking === false || request.type != "GET") {
|
||||||
logger.log('Requesting url without automatic networking: ' + request.url);
|
console.log('Requesting url without automatic networking: ' + request.url);
|
||||||
|
|
||||||
return getFetchPromise(request).then(function (response) {
|
return getFetchPromise(request).then(function (response) {
|
||||||
|
|
||||||
|
@ -337,7 +333,7 @@
|
||||||
connectionMode = switchConnectionMode(connectionMode);
|
connectionMode = switchConnectionMode(connectionMode);
|
||||||
var url = MediaBrowser.ServerInfo.getServerAddress(self.serverInfo(), connectionMode);
|
var url = MediaBrowser.ServerInfo.getServerAddress(self.serverInfo(), connectionMode);
|
||||||
|
|
||||||
logger.log("Attempting reconnection to " + url);
|
console.log("Attempting reconnection to " + url);
|
||||||
|
|
||||||
var timeout = connectionMode == MediaBrowser.ConnectionMode.Local ? 7000 : 15000;
|
var timeout = connectionMode == MediaBrowser.ConnectionMode.Local ? 7000 : 15000;
|
||||||
|
|
||||||
|
@ -351,7 +347,7 @@
|
||||||
|
|
||||||
}, timeout).then(function () {
|
}, timeout).then(function () {
|
||||||
|
|
||||||
logger.log("Reconnect succeeded to " + url);
|
console.log("Reconnect succeeded to " + url);
|
||||||
|
|
||||||
self.serverInfo().LastConnectionMode = connectionMode;
|
self.serverInfo().LastConnectionMode = connectionMode;
|
||||||
self.serverAddress(url);
|
self.serverAddress(url);
|
||||||
|
@ -360,7 +356,7 @@
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
||||||
logger.log("Reconnect attempt failed to " + url);
|
console.log("Reconnect attempt failed to " + url);
|
||||||
|
|
||||||
if (currentRetryCount < 5) {
|
if (currentRetryCount < 5) {
|
||||||
|
|
||||||
|
@ -388,7 +384,7 @@
|
||||||
|
|
||||||
self.fetchWithFailover = function (request, enableReconnection) {
|
self.fetchWithFailover = function (request, enableReconnection) {
|
||||||
|
|
||||||
logger.log("Requesting " + request.url);
|
console.log("Requesting " + request.url);
|
||||||
|
|
||||||
request.timeout = 30000;
|
request.timeout = 30000;
|
||||||
|
|
||||||
|
@ -408,32 +404,32 @@
|
||||||
|
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
|
||||||
logger.log("Request failed to " + request.url);
|
console.log("Request failed to " + request.url);
|
||||||
|
|
||||||
// http://api.jquery.com/jQuery.ajax/
|
// http://api.jquery.com/jQuery.ajax/
|
||||||
if (enableReconnection) {
|
if (enableReconnection) {
|
||||||
|
|
||||||
logger.log("Attempting reconnection");
|
console.log("Attempting reconnection");
|
||||||
|
|
||||||
var previousServerAddress = self.serverAddress();
|
var previousServerAddress = self.serverAddress();
|
||||||
|
|
||||||
return tryReconnect().then(function () {
|
return tryReconnect().then(function () {
|
||||||
|
|
||||||
logger.log("Reconnect succeesed");
|
console.log("Reconnect succeesed");
|
||||||
request.url = request.url.replace(previousServerAddress, self.serverAddress());
|
request.url = request.url.replace(previousServerAddress, self.serverAddress());
|
||||||
|
|
||||||
return self.fetchWithFailover(request, false);
|
return self.fetchWithFailover(request, false);
|
||||||
|
|
||||||
}, function (innerError) {
|
}, function (innerError) {
|
||||||
|
|
||||||
logger.log("Reconnect failed");
|
console.log("Reconnect failed");
|
||||||
onFetchFail(request.url, {});
|
onFetchFail(request.url, {});
|
||||||
throw innerError;
|
throw innerError;
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
logger.log("Reporting request failure");
|
console.log("Reporting request failure");
|
||||||
|
|
||||||
onFetchFail(request.url, {});
|
onFetchFail(request.url, {});
|
||||||
throw error;
|
throw error;
|
||||||
|
@ -496,7 +492,7 @@
|
||||||
throw new Error('connectionMode cannot be null');
|
throw new Error('connectionMode cannot be null');
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log('Begin updateServerInfo. connectionMode: ' + connectionMode);
|
console.log('Begin updateServerInfo. connectionMode: ' + connectionMode);
|
||||||
|
|
||||||
self.serverInfo(server);
|
self.serverInfo(server);
|
||||||
|
|
||||||
|
@ -505,7 +501,7 @@
|
||||||
if (!serverUrl) {
|
if (!serverUrl) {
|
||||||
throw new Error('serverUrl cannot be null. serverInfo: ' + JSON.stringify(server));
|
throw new Error('serverUrl cannot be null. serverInfo: ' + JSON.stringify(server));
|
||||||
}
|
}
|
||||||
logger.log('Setting server address to ' + serverUrl);
|
console.log('Setting server address to ' + serverUrl);
|
||||||
self.serverAddress(serverUrl);
|
self.serverAddress(serverUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -536,7 +532,7 @@
|
||||||
|
|
||||||
webSocket.onopen = function () {
|
webSocket.onopen = function () {
|
||||||
|
|
||||||
logger.log('web socket connection opened');
|
console.log('web socket connection opened');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
Events.trigger(self, 'websocketopen');
|
Events.trigger(self, 'websocketopen');
|
||||||
}, 0);
|
}, 0);
|
||||||
|
@ -578,7 +574,7 @@
|
||||||
|
|
||||||
self.sendWebSocketMessage = function (name, data) {
|
self.sendWebSocketMessage = function (name, data) {
|
||||||
|
|
||||||
logger.log('Sending web socket message: ' + name);
|
console.log('Sending web socket message: ' + name);
|
||||||
|
|
||||||
var msg = { MessageType: name };
|
var msg = { MessageType: name };
|
||||||
|
|
||||||
|
@ -3412,5 +3408,4 @@
|
||||||
return self.getJSON(url);
|
return self.getJSON(url);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
});
|
||||||
})(window, window.JSON, window.WebSocket, window.setTimeout, window.devicePixelRatio, window.FileReader);
|
|
|
@ -11,7 +11,8 @@
|
||||||
"license": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript/blob/master/LICENSE",
|
"license": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript/blob/master/LICENSE",
|
||||||
"homepage": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript",
|
"homepage": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cryptojslib": "cryptojslib#^3.1.2"
|
"cryptojslib": "cryptojslib#^3.1.2",
|
||||||
|
"requirejs": "requirejs#^2.1.22"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
(function (globalScope) {
|
define(['events', 'apiclient'], function (Events, apiClientFactory) {
|
||||||
|
|
||||||
if (!globalScope.MediaBrowser) {
|
var ConnectionState = {
|
||||||
globalScope.MediaBrowser = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
globalScope.MediaBrowser.ConnectionState = {
|
|
||||||
Unavailable: 0,
|
Unavailable: 0,
|
||||||
ServerSelection: 1,
|
ServerSelection: 1,
|
||||||
ServerSignIn: 2,
|
ServerSignIn: 2,
|
||||||
|
@ -12,22 +8,22 @@
|
||||||
ConnectSignIn: 4
|
ConnectSignIn: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
globalScope.MediaBrowser.ConnectionMode = {
|
var ConnectionMode = {
|
||||||
Local: 0,
|
Local: 0,
|
||||||
Remote: 1,
|
Remote: 1,
|
||||||
Manual: 2
|
Manual: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
globalScope.MediaBrowser.ServerInfo = {
|
var ServerInfo = {
|
||||||
|
|
||||||
getServerAddress: function (server, mode) {
|
getServerAddress: function (server, mode) {
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case MediaBrowser.ConnectionMode.Local:
|
case ConnectionMode.Local:
|
||||||
return server.LocalAddress;
|
return server.LocalAddress;
|
||||||
case MediaBrowser.ConnectionMode.Manual:
|
case ConnectionMode.Manual:
|
||||||
return server.ManualAddress;
|
return server.ManualAddress;
|
||||||
case MediaBrowser.ConnectionMode.Remote:
|
case ConnectionMode.Remote:
|
||||||
return server.RemoteAddress;
|
return server.RemoteAddress;
|
||||||
default:
|
default:
|
||||||
return server.ManualAddress || server.LocalAddress || server.RemoteAddress;
|
return server.ManualAddress || server.LocalAddress || server.RemoteAddress;
|
||||||
|
@ -35,9 +31,9 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
globalScope.MediaBrowser.ConnectionManager = function (logger, credentialProvider, appName, appVersion, deviceName, deviceId, capabilities) {
|
var ConnectionManager = function (credentialProvider, appName, appVersion, deviceName, deviceId, capabilities, devicePixelRatio) {
|
||||||
|
|
||||||
logger.log('Begin MediaBrowser.ConnectionManager constructor');
|
console.log('Begin ConnectionManager constructor');
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var apiClients = [];
|
var apiClients = [];
|
||||||
|
@ -55,7 +51,7 @@
|
||||||
function resolveFailure(resolve) {
|
function resolveFailure(resolve) {
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
State: MediaBrowser.ConnectionState.Unavailable,
|
State: ConnectionState.Unavailable,
|
||||||
ConnectUser: self.connectUser()
|
ConnectUser: self.connectUser()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -122,7 +118,7 @@
|
||||||
|
|
||||||
function fetchWithTimeout(url, options, timeoutMs) {
|
function fetchWithTimeout(url, options, timeoutMs) {
|
||||||
|
|
||||||
logger.log('fetchWithTimeout: timeoutMs: ' + timeoutMs + ', url: ' + url);
|
console.log('fetchWithTimeout: timeoutMs: ' + timeoutMs + ', url: ' + url);
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
@ -131,14 +127,14 @@
|
||||||
fetch(url, options).then(function (response) {
|
fetch(url, options).then(function (response) {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
logger.log('fetchWithTimeout: succeeded connecting to url: ' + url);
|
console.log('fetchWithTimeout: succeeded connecting to url: ' + url);
|
||||||
|
|
||||||
resolve(response);
|
resolve(response);
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
logger.log('fetchWithTimeout: timed out connecting to url: ' + url);
|
console.log('fetchWithTimeout: timed out connecting to url: ' + url);
|
||||||
|
|
||||||
reject();
|
reject();
|
||||||
});
|
});
|
||||||
|
@ -168,11 +164,11 @@
|
||||||
|
|
||||||
request.headers = request.headers || {};
|
request.headers = request.headers || {};
|
||||||
|
|
||||||
logger.log('ConnectionManager requesting url: ' + request.url);
|
console.log('ConnectionManager requesting url: ' + request.url);
|
||||||
|
|
||||||
return getFetchPromise(request).then(function (response) {
|
return getFetchPromise(request).then(function (response) {
|
||||||
|
|
||||||
logger.log('ConnectionManager response status: ' + response.status + ', url: ' + request.url);
|
console.log('ConnectionManager response status: ' + response.status + ', url: ' + request.url);
|
||||||
|
|
||||||
if (response.status < 400) {
|
if (response.status < 400) {
|
||||||
|
|
||||||
|
@ -187,7 +183,7 @@
|
||||||
|
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
|
|
||||||
logger.log('ConnectionManager request failed to url: ' + request.url);
|
console.log('ConnectionManager request failed to url: ' + request.url);
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -196,7 +192,7 @@
|
||||||
|
|
||||||
url = getEmbyServerUrl(url, "system/info/public");
|
url = getEmbyServerUrl(url, "system/info/public");
|
||||||
|
|
||||||
logger.log('tryConnect url: ' + url);
|
console.log('tryConnect url: ' + url);
|
||||||
|
|
||||||
return ajax({
|
return ajax({
|
||||||
|
|
||||||
|
@ -296,8 +292,8 @@
|
||||||
|
|
||||||
var existingServer = existingServers.length ? existingServers[0] : {};
|
var existingServer = existingServers.length ? existingServers[0] : {};
|
||||||
existingServer.DateLastAccessed = new Date().getTime();
|
existingServer.DateLastAccessed = new Date().getTime();
|
||||||
existingServer.LastConnectionMode = MediaBrowser.ConnectionMode.Manual;
|
existingServer.LastConnectionMode = ConnectionMode.Manual;
|
||||||
if (existingServer.LastConnectionMode == MediaBrowser.ConnectionMode.Local) {
|
if (existingServer.LastConnectionMode == ConnectionMode.Local) {
|
||||||
existingServer.DateLastLocalConnection = new Date().getTime();
|
existingServer.DateLastLocalConnection = new Date().getTime();
|
||||||
}
|
}
|
||||||
existingServer.ManualAddress = apiClient.serverAddress();
|
existingServer.ManualAddress = apiClient.serverAddress();
|
||||||
|
@ -332,7 +328,7 @@
|
||||||
|
|
||||||
self.clearData = function () {
|
self.clearData = function () {
|
||||||
|
|
||||||
logger.log('connection manager clearing data');
|
console.log('connection manager clearing data');
|
||||||
|
|
||||||
connectUser = null;
|
connectUser = null;
|
||||||
var credentials = credentialProvider.credentials();
|
var credentials = credentialProvider.credentials();
|
||||||
|
@ -354,9 +350,9 @@
|
||||||
|
|
||||||
if (!apiClient) {
|
if (!apiClient) {
|
||||||
|
|
||||||
var url = MediaBrowser.ServerInfo.getServerAddress(server, connectionMode);
|
var url = ServerInfo.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
apiClient = new MediaBrowser.ApiClient(logger, url, appName, appVersion, deviceName, deviceId);
|
apiClient = new apiClientFactory(url, appName, appVersion, deviceName, deviceId, devicePixelRatio);
|
||||||
|
|
||||||
apiClients.push(apiClient);
|
apiClients.push(apiClient);
|
||||||
|
|
||||||
|
@ -369,7 +365,7 @@
|
||||||
Events.trigger(self, 'apiclientcreated', [apiClient]);
|
Events.trigger(self, 'apiclientcreated', [apiClient]);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log('returning instance from getOrAddApiClient');
|
console.log('returning instance from getOrAddApiClient');
|
||||||
return apiClient;
|
return apiClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +398,7 @@
|
||||||
if (options.updateDateLastAccessed !== false) {
|
if (options.updateDateLastAccessed !== false) {
|
||||||
server.DateLastAccessed = new Date().getTime();
|
server.DateLastAccessed = new Date().getTime();
|
||||||
|
|
||||||
if (server.LastConnectionMode == MediaBrowser.ConnectionMode.Local) {
|
if (server.LastConnectionMode == ConnectionMode.Local) {
|
||||||
server.DateLastLocalConnection = new Date().getTime();
|
server.DateLastLocalConnection = new Date().getTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -438,14 +434,14 @@
|
||||||
function afterConnected(apiClient, options) {
|
function afterConnected(apiClient, options) {
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
if (options.reportCapabilities !== false) {
|
if (options.reportCapabilities !== false) {
|
||||||
apiClient.reportCapabilities(capabilities);
|
apiClient.reportCapabilities(capabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.enableWebSocket !== false) {
|
if (options.enableWebSocket !== false) {
|
||||||
if (!apiClient.isWebSocketOpenOrConnecting && apiClient.isWebSocketSupported()) {
|
if (!apiClient.isWebSocketOpenOrConnecting() && apiClient.isWebSocketSupported()) {
|
||||||
logger.log('calling apiClient.openWebSocket');
|
|
||||||
|
console.log('calling apiClient.openWebSocket');
|
||||||
|
|
||||||
apiClient.openWebSocket();
|
apiClient.openWebSocket();
|
||||||
}
|
}
|
||||||
|
@ -516,7 +512,7 @@
|
||||||
throw new Error("credentials.ConnectUserId cannot be null");
|
throw new Error("credentials.ConnectUserId cannot be null");
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = MediaBrowser.ServerInfo.getServerAddress(server, connectionMode);
|
var url = ServerInfo.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
url = getEmbyServerUrl(url, "Connect/Exchange?format=json&ConnectUserId=" + credentials.ConnectUserId);
|
url = getEmbyServerUrl(url, "Connect/Exchange?format=json&ConnectUserId=" + credentials.ConnectUserId);
|
||||||
|
|
||||||
|
@ -547,7 +543,7 @@
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
var url = MediaBrowser.ServerInfo.getServerAddress(server, connectionMode);
|
var url = ServerInfo.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
ajax({
|
ajax({
|
||||||
|
|
||||||
|
@ -675,7 +671,7 @@
|
||||||
|
|
||||||
self.logout = function () {
|
self.logout = function () {
|
||||||
|
|
||||||
Logger.log('begin connectionManager loguot');
|
console.log('begin connectionManager loguot');
|
||||||
var promises = [];
|
var promises = [];
|
||||||
|
|
||||||
for (var i = 0, length = apiClients.length; i < length; i++) {
|
for (var i = 0, length = apiClients.length; i < length; i++) {
|
||||||
|
@ -743,7 +739,7 @@
|
||||||
|
|
||||||
function getConnectServers(credentials) {
|
function getConnectServers(credentials) {
|
||||||
|
|
||||||
logger.log('Begin getConnectServers');
|
console.log('Begin getConnectServers');
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
@ -801,7 +797,7 @@
|
||||||
|
|
||||||
self.getAvailableServers = function () {
|
self.getAvailableServers = function () {
|
||||||
|
|
||||||
logger.log('Begin getAvailableServers');
|
console.log('Begin getAvailableServers');
|
||||||
|
|
||||||
// Clone the array
|
// Clone the array
|
||||||
var credentials = credentialProvider.credentials();
|
var credentials = credentialProvider.credentials();
|
||||||
|
@ -863,7 +859,7 @@
|
||||||
DateLastLocalConnection: new Date().getTime()
|
DateLastLocalConnection: new Date().getTime()
|
||||||
};
|
};
|
||||||
|
|
||||||
info.LastConnectionMode = info.ManualAddress ? MediaBrowser.ConnectionMode.Manual : MediaBrowser.ConnectionMode.Local;
|
info.LastConnectionMode = info.ManualAddress ? ConnectionMode.Manual : ConnectionMode.Local;
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
});
|
});
|
||||||
|
@ -897,7 +893,7 @@
|
||||||
|
|
||||||
self.connect = function () {
|
self.connect = function () {
|
||||||
|
|
||||||
logger.log('Begin connect');
|
console.log('Begin connect');
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
@ -918,7 +914,7 @@
|
||||||
|
|
||||||
self.connectToServers = function (servers) {
|
self.connectToServers = function (servers) {
|
||||||
|
|
||||||
logger.log('Begin connectToServers, with ' + servers.length + ' servers');
|
console.log('Begin connectToServers, with ' + servers.length + ' servers');
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
@ -926,14 +922,14 @@
|
||||||
|
|
||||||
self.connectToServer(servers[0]).then(function (result) {
|
self.connectToServer(servers[0]).then(function (result) {
|
||||||
|
|
||||||
if (result.State == MediaBrowser.ConnectionState.Unavailable) {
|
if (result.State == ConnectionState.Unavailable) {
|
||||||
|
|
||||||
result.State = result.ConnectUser == null ?
|
result.State = result.ConnectUser == null ?
|
||||||
MediaBrowser.ConnectionState.ConnectSignIn :
|
ConnectionState.ConnectSignIn :
|
||||||
MediaBrowser.ConnectionState.ServerSelection;
|
ConnectionState.ServerSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log('resolving connectToServers with result.State: ' + result.State);
|
console.log('resolving connectToServers with result.State: ' + result.State);
|
||||||
resolve(result);
|
resolve(result);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -945,14 +941,14 @@
|
||||||
if (firstServer) {
|
if (firstServer) {
|
||||||
self.connectToServer(firstServer).then(function (result) {
|
self.connectToServer(firstServer).then(function (result) {
|
||||||
|
|
||||||
if (result.State == MediaBrowser.ConnectionState.SignedIn) {
|
if (result.State == ConnectionState.SignedIn) {
|
||||||
|
|
||||||
resolve(result);
|
resolve(result);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
resolve({
|
resolve({
|
||||||
Servers: servers,
|
Servers: servers,
|
||||||
State: (!servers.length && !self.connectUser()) ? MediaBrowser.ConnectionState.ConnectSignIn : MediaBrowser.ConnectionState.ServerSelection,
|
State: (!servers.length && !self.connectUser()) ? ConnectionState.ConnectSignIn : ConnectionState.ServerSelection,
|
||||||
ConnectUser: self.connectUser()
|
ConnectUser: self.connectUser()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -962,7 +958,7 @@
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
Servers: servers,
|
Servers: servers,
|
||||||
State: (!servers.length && !self.connectUser()) ? MediaBrowser.ConnectionState.ConnectSignIn : MediaBrowser.ConnectionState.ServerSelection,
|
State: (!servers.length && !self.connectUser()) ? ConnectionState.ConnectSignIn : ConnectionState.ServerSelection,
|
||||||
ConnectUser: self.connectUser()
|
ConnectUser: self.connectUser()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -992,9 +988,9 @@
|
||||||
if (server.LastConnectionMode != null) {
|
if (server.LastConnectionMode != null) {
|
||||||
//tests.push(server.LastConnectionMode);
|
//tests.push(server.LastConnectionMode);
|
||||||
}
|
}
|
||||||
if (tests.indexOf(MediaBrowser.ConnectionMode.Manual) == -1) { tests.push(MediaBrowser.ConnectionMode.Manual); }
|
if (tests.indexOf(ConnectionMode.Manual) == -1) { tests.push(ConnectionMode.Manual); }
|
||||||
if (tests.indexOf(MediaBrowser.ConnectionMode.Local) == -1) { tests.push(MediaBrowser.ConnectionMode.Local); }
|
if (tests.indexOf(ConnectionMode.Local) == -1) { tests.push(ConnectionMode.Local); }
|
||||||
if (tests.indexOf(MediaBrowser.ConnectionMode.Remote) == -1) { tests.push(MediaBrowser.ConnectionMode.Remote); }
|
if (tests.indexOf(ConnectionMode.Remote) == -1) { tests.push(ConnectionMode.Remote); }
|
||||||
|
|
||||||
beginWakeServer(server);
|
beginWakeServer(server);
|
||||||
|
|
||||||
|
@ -1014,24 +1010,24 @@
|
||||||
|
|
||||||
if (index >= tests.length) {
|
if (index >= tests.length) {
|
||||||
|
|
||||||
logger.log('Tested all connection modes. Failing server connection.');
|
console.log('Tested all connection modes. Failing server connection.');
|
||||||
resolveFailure(resolve);
|
resolveFailure(resolve);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var mode = tests[index];
|
var mode = tests[index];
|
||||||
var address = MediaBrowser.ServerInfo.getServerAddress(server, mode);
|
var address = ServerInfo.getServerAddress(server, mode);
|
||||||
var enableRetry = false;
|
var enableRetry = false;
|
||||||
var skipTest = false;
|
var skipTest = false;
|
||||||
var timeout = defaultTimeout;
|
var timeout = defaultTimeout;
|
||||||
|
|
||||||
if (mode == MediaBrowser.ConnectionMode.Local) {
|
if (mode == ConnectionMode.Local) {
|
||||||
|
|
||||||
enableRetry = true;
|
enableRetry = true;
|
||||||
timeout = 8000;
|
timeout = 8000;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (mode == MediaBrowser.ConnectionMode.Manual) {
|
else if (mode == ConnectionMode.Manual) {
|
||||||
|
|
||||||
if (stringEqualsIgnoreCase(address, server.LocalAddress) ||
|
if (stringEqualsIgnoreCase(address, server.LocalAddress) ||
|
||||||
stringEqualsIgnoreCase(address, server.RemoteAddress)) {
|
stringEqualsIgnoreCase(address, server.RemoteAddress)) {
|
||||||
|
@ -1044,16 +1040,16 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log('testing connection mode ' + mode + ' with server ' + server.Name);
|
console.log('testing connection mode ' + mode + ' with server ' + server.Name);
|
||||||
|
|
||||||
tryConnect(address, timeout).then(function (result) {
|
tryConnect(address, timeout).then(function (result) {
|
||||||
|
|
||||||
logger.log('calling onSuccessfulConnection with connection mode ' + mode + ' with server ' + server.Name);
|
console.log('calling onSuccessfulConnection with connection mode ' + mode + ' with server ' + server.Name);
|
||||||
onSuccessfulConnection(server, result, mode, options, resolve);
|
onSuccessfulConnection(server, result, mode, options, resolve);
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
||||||
logger.log('test failed for connection mode ' + mode + ' with server ' + server.Name);
|
console.log('test failed for connection mode ' + mode + ' with server ' + server.Name);
|
||||||
|
|
||||||
if (enableRetry) {
|
if (enableRetry) {
|
||||||
|
|
||||||
|
@ -1117,7 +1113,7 @@
|
||||||
if (options.updateDateLastAccessed !== false) {
|
if (options.updateDateLastAccessed !== false) {
|
||||||
server.DateLastAccessed = new Date().getTime();
|
server.DateLastAccessed = new Date().getTime();
|
||||||
|
|
||||||
if (server.LastConnectionMode == MediaBrowser.ConnectionMode.Local) {
|
if (server.LastConnectionMode == ConnectionMode.Local) {
|
||||||
server.DateLastLocalConnection = new Date().getTime();
|
server.DateLastLocalConnection = new Date().getTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1130,13 +1126,13 @@
|
||||||
|
|
||||||
result.ApiClient = getOrAddApiClient(server, connectionMode);
|
result.ApiClient = getOrAddApiClient(server, connectionMode);
|
||||||
result.State = server.AccessToken ?
|
result.State = server.AccessToken ?
|
||||||
MediaBrowser.ConnectionState.SignedIn :
|
ConnectionState.SignedIn :
|
||||||
MediaBrowser.ConnectionState.ServerSignIn;
|
ConnectionState.ServerSignIn;
|
||||||
|
|
||||||
result.Servers.push(server);
|
result.Servers.push(server);
|
||||||
result.ApiClient.updateServerInfo(server, connectionMode);
|
result.ApiClient.updateServerInfo(server, connectionMode);
|
||||||
|
|
||||||
if (result.State == MediaBrowser.ConnectionState.SignedIn) {
|
if (result.State == ConnectionState.SignedIn) {
|
||||||
afterConnected(result.ApiClient, options);
|
afterConnected(result.ApiClient, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1173,17 +1169,17 @@
|
||||||
address = normalizeAddress(address);
|
address = normalizeAddress(address);
|
||||||
|
|
||||||
function onFail() {
|
function onFail() {
|
||||||
logger.log('connectToAddress ' + address + ' failed');
|
console.log('connectToAddress ' + address + ' failed');
|
||||||
resolveFailure(resolve);
|
resolveFailure(resolve);
|
||||||
}
|
}
|
||||||
|
|
||||||
tryConnect(address, defaultTimeout).then(function (publicInfo) {
|
tryConnect(address, defaultTimeout).then(function (publicInfo) {
|
||||||
|
|
||||||
logger.log('connectToAddress ' + address + ' succeeded');
|
console.log('connectToAddress ' + address + ' succeeded');
|
||||||
|
|
||||||
var server = {
|
var server = {
|
||||||
ManualAddress: address,
|
ManualAddress: address,
|
||||||
LastConnectionMode: MediaBrowser.ConnectionMode.Manual
|
LastConnectionMode: ConnectionMode.Manual
|
||||||
};
|
};
|
||||||
updateServerInfo(server, publicInfo);
|
updateServerInfo(server, publicInfo);
|
||||||
|
|
||||||
|
@ -1207,9 +1203,9 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require(['connectservice', 'cryptojs-md5'], function () {
|
require(['connectservice', 'cryptojs-md5'], function (connectservice) {
|
||||||
|
|
||||||
var md5 = self.getConnectPasswordHash(password);
|
var md5 = getConnectPasswordHash(connectservice, password);
|
||||||
|
|
||||||
ajax({
|
ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
@ -1267,9 +1263,9 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require(['connectservice', 'cryptojs-md5'], function () {
|
require(['connectservice', 'cryptojs-md5'], function (connectservice) {
|
||||||
|
|
||||||
var md5 = self.getConnectPasswordHash(password);
|
var md5 = getConnectPasswordHash(connectservice, password);
|
||||||
|
|
||||||
ajax({
|
ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
@ -1306,12 +1302,12 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getConnectPasswordHash = function (password) {
|
function getConnectPasswordHash(connectService, password) {
|
||||||
|
|
||||||
password = globalScope.MediaBrowser.ConnectService.cleanPassword(password);
|
password = connectService.cleanPassword(password);
|
||||||
|
|
||||||
return CryptoJS.MD5(password).toString();
|
return CryptoJS.MD5(password).toString();
|
||||||
};
|
}
|
||||||
|
|
||||||
self.getApiClient = function (item) {
|
self.getApiClient = function (item) {
|
||||||
|
|
||||||
|
@ -1511,4 +1507,10 @@
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
})(window, window.Logger);
|
return {
|
||||||
|
ConnectionState: ConnectionState,
|
||||||
|
ConnectionMode: ConnectionMode,
|
||||||
|
ServerInfo: ServerInfo,
|
||||||
|
ConnectionManager: ConnectionManager
|
||||||
|
};
|
||||||
|
});
|
|
@ -1,15 +1,6 @@
|
||||||
(function (globalScope) {
|
define([], function () {
|
||||||
|
|
||||||
if (!globalScope.MediaBrowser) {
|
return {
|
||||||
globalScope.MediaBrowser = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
function replaceAll(str, find, replace) {
|
|
||||||
|
|
||||||
return str.split(find).join(replace);
|
|
||||||
}
|
|
||||||
|
|
||||||
var connectService = {
|
|
||||||
|
|
||||||
cleanPassword: function (password) {
|
cleanPassword: function (password) {
|
||||||
|
|
||||||
|
@ -26,9 +17,5 @@
|
||||||
|
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
});
|
||||||
globalScope.MediaBrowser.ConnectService = connectService;
|
|
||||||
|
|
||||||
})(window);
|
|
|
@ -1,10 +1,6 @@
|
||||||
(function (globalScope, JSON) {
|
define(['events'], function (Events) {
|
||||||
|
|
||||||
if (!globalScope.MediaBrowser) {
|
return function (key) {
|
||||||
globalScope.MediaBrowser = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
globalScope.MediaBrowser.CredentialProvider = function (key) {
|
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var credentials = null;
|
var credentials = null;
|
||||||
|
@ -16,7 +12,7 @@
|
||||||
|
|
||||||
var json = appStorage.getItem(key) || '{}';
|
var json = appStorage.getItem(key) || '{}';
|
||||||
|
|
||||||
Logger.log('credentials initialized with: ' + json);
|
console.log('credentials initialized with: ' + json);
|
||||||
credentials = JSON.parse(json);
|
credentials = JSON.parse(json);
|
||||||
credentials.Servers = credentials.Servers || [];
|
credentials.Servers = credentials.Servers || [];
|
||||||
}
|
}
|
||||||
|
@ -127,5 +123,4 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
});
|
||||||
})(window, window.JSON);
|
|
|
@ -1,20 +1,61 @@
|
||||||
(function (globalScope) {
|
define([], function () {
|
||||||
|
|
||||||
globalScope.Events = {
|
function getCallbacks(obj, name) {
|
||||||
|
|
||||||
on: function (obj, eventName, selector, fn) {
|
if (!obj) {
|
||||||
|
throw new Error("obj cannot be null!");
|
||||||
jQuery(obj).on(eventName, selector, fn);
|
|
||||||
},
|
|
||||||
|
|
||||||
off: function (obj, eventName, selector, fn) {
|
|
||||||
|
|
||||||
jQuery(obj).off(eventName, selector, fn);
|
|
||||||
},
|
|
||||||
|
|
||||||
trigger: function (obj, eventName, params) {
|
|
||||||
jQuery(obj).trigger(eventName, params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
obj._callbacks = obj._callbacks || {};
|
||||||
|
|
||||||
|
var list = obj._callbacks[name];
|
||||||
|
|
||||||
|
if (!list) {
|
||||||
|
obj._callbacks[name] = [];
|
||||||
|
list = obj._callbacks[name];
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
on: function (obj, eventName, fn) {
|
||||||
|
|
||||||
|
var list = getCallbacks(obj, eventName);
|
||||||
|
|
||||||
|
list.push(fn);
|
||||||
|
},
|
||||||
|
|
||||||
|
off: function (obj, eventName, fn) {
|
||||||
|
|
||||||
|
var list = getCallbacks(obj, eventName);
|
||||||
|
|
||||||
|
var i = list.indexOf(fn);
|
||||||
|
if (i != -1) {
|
||||||
|
list.splice(i, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
trigger: function (obj, eventName) {
|
||||||
|
|
||||||
|
var eventObject = {
|
||||||
|
type: eventName
|
||||||
};
|
};
|
||||||
|
|
||||||
})(window);
|
var eventArgs = [];
|
||||||
|
eventArgs.push(eventObject);
|
||||||
|
|
||||||
|
var additionalArgs = arguments[2] || [];
|
||||||
|
for (var i = 0, length = additionalArgs.length; i < length; i++) {
|
||||||
|
eventArgs.push(additionalArgs[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var callbacks = getCallbacks(obj, eventName).slice(0);
|
||||||
|
|
||||||
|
callbacks.forEach(function (c) {
|
||||||
|
c.apply(obj, eventArgs);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
|
@ -1,6 +0,0 @@
|
||||||
var Logger = {
|
|
||||||
|
|
||||||
log: function (str) {
|
|
||||||
console.log(str);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
photos = getFilesToUpload(photos, uploadHistory);
|
photos = getFilesToUpload(photos, uploadHistory);
|
||||||
|
|
||||||
Logger.log('Found ' + photos.length + ' files to upload');
|
console.log('Found ' + photos.length + ' files to upload');
|
||||||
|
|
||||||
uploadNext(photos, 0, server, apiClient, deferred);
|
uploadNext(photos, 0, server, apiClient, deferred);
|
||||||
|
|
||||||
|
@ -91,16 +91,16 @@
|
||||||
api_key: apiClient.accessToken()
|
api_key: apiClient.accessToken()
|
||||||
});
|
});
|
||||||
|
|
||||||
Logger.log('Uploading file to ' + url);
|
console.log('Uploading file to ' + url);
|
||||||
|
|
||||||
new MediaBrowser.FileUpload().upload(file, name, url).then(function () {
|
new MediaBrowser.FileUpload().upload(file, name, url).then(function () {
|
||||||
|
|
||||||
Logger.log('File upload succeeded');
|
console.log('File upload succeeded');
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
||||||
Logger.log('File upload failed');
|
console.log('File upload failed');
|
||||||
deferred.reject();
|
deferred.reject();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
function reportOfflineActions(apiClient, serverInfo) {
|
function reportOfflineActions(apiClient, serverInfo) {
|
||||||
|
|
||||||
Logger.log('Begin reportOfflineActions');
|
console.log('Begin reportOfflineActions');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
|
|
||||||
function syncData(apiClient, serverInfo, syncUserItemAccess) {
|
function syncData(apiClient, serverInfo, syncUserItemAccess) {
|
||||||
|
|
||||||
Logger.log('Begin syncData');
|
console.log('Begin syncData');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
function afterSyncData(apiClient, serverInfo, enableSyncUserItemAccess, syncDataResult, deferred) {
|
function afterSyncData(apiClient, serverInfo, enableSyncUserItemAccess, syncDataResult, deferred) {
|
||||||
|
|
||||||
Logger.log('Begin afterSyncData');
|
console.log('Begin afterSyncData');
|
||||||
|
|
||||||
removeLocalItems(syncDataResult, serverInfo.Id).then(function (result) {
|
removeLocalItems(syncDataResult, serverInfo.Id).then(function (result) {
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
|
|
||||||
function removeLocalItems(syncDataResult, serverId) {
|
function removeLocalItems(syncDataResult, serverId) {
|
||||||
|
|
||||||
Logger.log('Begin removeLocalItems');
|
console.log('Begin removeLocalItems');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
|
|
||||||
function removeLocalItem(itemId, serverId) {
|
function removeLocalItem(itemId, serverId) {
|
||||||
|
|
||||||
Logger.log('Begin removeLocalItem');
|
console.log('Begin removeLocalItem');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
|
|
||||||
function getNewMedia(apiClient, serverInfo, options) {
|
function getNewMedia(apiClient, serverInfo, options) {
|
||||||
|
|
||||||
Logger.log('Begin getNewMedia');
|
console.log('Begin getNewMedia');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@
|
||||||
|
|
||||||
function getNewItem(jobItem, apiClient, serverInfo, options) {
|
function getNewItem(jobItem, apiClient, serverInfo, options) {
|
||||||
|
|
||||||
Logger.log('Begin getNewItem');
|
console.log('Begin getNewItem');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@
|
||||||
|
|
||||||
function downloadMedia(apiClient, jobItem, localItem, options) {
|
function downloadMedia(apiClient, jobItem, localItem, options) {
|
||||||
|
|
||||||
Logger.log('Begin downloadMedia');
|
console.log('Begin downloadMedia');
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
require(['localassetmanager'], function () {
|
require(['localassetmanager'], function () {
|
||||||
|
@ -250,7 +250,7 @@
|
||||||
|
|
||||||
var localPath = localItem.LocalPath;
|
var localPath = localItem.LocalPath;
|
||||||
|
|
||||||
Logger.log('Downloading media. Url: ' + url + '. Local path: ' + localPath);
|
console.log('Downloading media. Url: ' + url + '. Local path: ' + localPath);
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@
|
||||||
|
|
||||||
function getImages(apiClient, jobItem, localItem) {
|
function getImages(apiClient, jobItem, localItem) {
|
||||||
|
|
||||||
Logger.log('Begin getImages');
|
console.log('Begin getImages');
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
getNextImage(0, apiClient, localItem, deferred);
|
getNextImage(0, apiClient, localItem, deferred);
|
||||||
|
@ -285,7 +285,7 @@
|
||||||
|
|
||||||
function getNextImage(index, apiClient, localItem, deferred) {
|
function getNextImage(index, apiClient, localItem, deferred) {
|
||||||
|
|
||||||
Logger.log('Begin getNextImage');
|
console.log('Begin getNextImage');
|
||||||
if (index >= 4) {
|
if (index >= 4) {
|
||||||
|
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
|
@ -347,7 +347,7 @@
|
||||||
|
|
||||||
function downloadImage(apiClient, serverId, itemId, imageTag, imageType) {
|
function downloadImage(apiClient, serverId, itemId, imageTag, imageType) {
|
||||||
|
|
||||||
Logger.log('Begin downloadImage');
|
console.log('Begin downloadImage');
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
require(['localassetmanager'], function () {
|
require(['localassetmanager'], function () {
|
||||||
|
@ -379,13 +379,13 @@
|
||||||
|
|
||||||
function getSubtitles(apiClient, jobItem, localItem) {
|
function getSubtitles(apiClient, jobItem, localItem) {
|
||||||
|
|
||||||
Logger.log('Begin getSubtitles');
|
console.log('Begin getSubtitles');
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
require(['localassetmanager'], function () {
|
require(['localassetmanager'], function () {
|
||||||
|
|
||||||
if (!jobItem.Item.MediaSources.length) {
|
if (!jobItem.Item.MediaSources.length) {
|
||||||
logger.Error("Cannot download subtitles because video has no media source info.");
|
console.log("Cannot download subtitles because video has no media source info.");
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@
|
||||||
|
|
||||||
function getItemSubtitle(file, apiClient, jobItem, localItem, mediaSource) {
|
function getItemSubtitle(file, apiClient, jobItem, localItem, mediaSource) {
|
||||||
|
|
||||||
Logger.log('Begin getItemSubtitle');
|
console.log('Begin getItemSubtitle');
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
var subtitleStream = mediaSource.MediaStreams.filter(function (m) {
|
var subtitleStream = mediaSource.MediaStreams.filter(function (m) {
|
||||||
|
@ -433,7 +433,7 @@
|
||||||
if (!subtitleStream) {
|
if (!subtitleStream) {
|
||||||
|
|
||||||
// We shouldn't get in here, but let's just be safe anyway
|
// We shouldn't get in here, but let's just be safe anyway
|
||||||
Logger.log("Cannot download subtitles because matching stream info wasn't found.");
|
console.log("Cannot download subtitles because matching stream info wasn't found.");
|
||||||
deferred.reject();
|
deferred.reject();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -459,7 +459,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncUserItemAccess(syncDataResult, serverId) {
|
function syncUserItemAccess(syncDataResult, serverId) {
|
||||||
Logger.log('Begin syncUserItemAccess');
|
console.log('Begin syncUserItemAccess');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncUserAccessForItem(itemId, syncDataResult) {
|
function syncUserAccessForItem(itemId, syncDataResult) {
|
||||||
Logger.log('Begin syncUserAccessForItem');
|
console.log('Begin syncUserAccessForItem');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
|
|
@ -6,38 +6,37 @@
|
||||||
|
|
||||||
self.sync = function (options) {
|
self.sync = function (options) {
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
var servers = connectionManager.getSavedServers();
|
var servers = connectionManager.getSavedServers();
|
||||||
|
|
||||||
syncNext(servers, 0, options, deferred);
|
syncNext(servers, 0, options, resolve, reject);
|
||||||
|
});
|
||||||
return deferred.promise();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function syncNext(servers, index, options, deferred) {
|
function syncNext(servers, index, options, resolve, reject) {
|
||||||
|
|
||||||
var length = servers.length;
|
var length = servers.length;
|
||||||
|
|
||||||
if (index >= length) {
|
if (index >= length) {
|
||||||
|
|
||||||
deferred.resolve();
|
resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var server = servers[index];
|
var server = servers[index];
|
||||||
|
|
||||||
Logger.log("Creating ServerSync to server: " + server.Id);
|
console.log("Creating ServerSync to server: " + server.Id);
|
||||||
|
|
||||||
require(['serversync'], function () {
|
require(['serversync'], function () {
|
||||||
|
|
||||||
new MediaBrowser.ServerSync(connectionManager).sync(server, options).then(function () {
|
new MediaBrowser.ServerSync(connectionManager).sync(server, options).then(function () {
|
||||||
|
|
||||||
syncNext(servers, index + 1, options, deferred);
|
syncNext(servers, index + 1, options, resolve, reject);
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
||||||
syncNext(servers, index + 1, options, deferred);
|
syncNext(servers, index + 1, options, resolve, reject);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,45 +6,39 @@
|
||||||
|
|
||||||
self.sync = function (apiClient, server) {
|
self.sync = function (apiClient, server) {
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
var users = server.Users || [];
|
var users = server.Users || [];
|
||||||
syncNext(users, 0, deferred, apiClient, server);
|
syncNext(users, 0, resolve, reject, apiClient, server);
|
||||||
|
});
|
||||||
return deferred.promise();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function syncNext(users, index, deferred, apiClient, server) {
|
function syncNext(users, index, resolve, reject, apiClient, server) {
|
||||||
|
|
||||||
var length = users.length;
|
var length = users.length;
|
||||||
|
|
||||||
if (index >= length) {
|
if (index >= length) {
|
||||||
|
|
||||||
deferred.resolve();
|
resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
syncUser(users[index], apiClient).then(function () {
|
var onFinish = function() {
|
||||||
|
syncNext(users, index + 1, resolve, reject, apiClient, server);
|
||||||
|
};
|
||||||
|
|
||||||
syncNext(users, index + 1, deferred, apiClient, server);
|
syncUser(users[index], apiClient).then(onFinish, onFinish);
|
||||||
}, function () {
|
|
||||||
syncNext(users, index + 1, deferred, apiClient, server);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncUser(user, apiClient) {
|
function syncUser(user, apiClient) {
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
apiClient.getOfflineUser(user.Id).then(function (result) {
|
apiClient.getOfflineUser(user.Id).then(function (result) {
|
||||||
|
|
||||||
require(['localassetmanager'], function () {
|
require(['localassetmanager'], function () {
|
||||||
|
|
||||||
LocalAssetManager.saveOfflineUser(result).then(function () {
|
LocalAssetManager.saveOfflineUser(result).then(resolve, resolve);
|
||||||
deferred.resolve();
|
|
||||||
}, function () {
|
|
||||||
deferred.resolve();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
@ -53,15 +47,10 @@
|
||||||
|
|
||||||
require(['localassetmanager'], function () {
|
require(['localassetmanager'], function () {
|
||||||
|
|
||||||
LocalAssetManager.deleteOfflineUser(user.Id).then(function () {
|
LocalAssetManager.deleteOfflineUser(user.Id).then(resolve, resolve);
|
||||||
deferred.resolve();
|
|
||||||
}, function () {
|
|
||||||
deferred.resolve();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return deferred.promise();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
|
|
||||||
self.sync = function (server, options) {
|
self.sync = function (server, options) {
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
|
||||||
|
|
||||||
if (!server.AccessToken && !server.ExchangeToken) {
|
if (!server.AccessToken && !server.ExchangeToken) {
|
||||||
|
|
||||||
Logger.log('Skipping sync to server ' + server.Id + ' because there is no saved authentication information.');
|
console.log('Skipping sync to server ' + server.Id + ' because there is no saved authentication information.');
|
||||||
deferred.resolve();
|
return new Promise(function (resolve, reject) {
|
||||||
return deferred.promise();
|
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var connectionOptions = {
|
var connectionOptions = {
|
||||||
|
@ -21,31 +21,25 @@
|
||||||
reportCapabilities: false
|
reportCapabilities: false
|
||||||
};
|
};
|
||||||
|
|
||||||
connectionManager.connectToServer(server, connectionOptions).then(function (result) {
|
return connectionManager.connectToServer(server, connectionOptions).then(function (result) {
|
||||||
|
|
||||||
if (result.State == MediaBrowser.ConnectionState.SignedIn) {
|
if (result.State == MediaBrowser.ConnectionState.SignedIn) {
|
||||||
performSync(server, options, deferred);
|
return performSync(server, options);
|
||||||
} else {
|
} else {
|
||||||
Logger.log('Unable to connect to server id: ' + server.Id);
|
console.log('Unable to connect to server id: ' + server.Id);
|
||||||
deferred.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, function () {
|
}, function (err) {
|
||||||
|
|
||||||
Logger.log('Unable to connect to server id: ' + server.Id);
|
console.log('Unable to connect to server id: ' + server.Id);
|
||||||
deferred.reject();
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
return deferred.promise();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function performSync(server, options, deferred) {
|
function performSync(server, options) {
|
||||||
|
|
||||||
Logger.log("Creating ContentUploader to server: " + server.Id);
|
console.log("Creating ContentUploader to server: " + server.Id);
|
||||||
|
|
||||||
var nextAction = function () {
|
|
||||||
syncOfflineUsers(server, options, deferred);
|
|
||||||
};
|
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
|
@ -56,54 +50,60 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!uploadPhotos) {
|
if (!uploadPhotos) {
|
||||||
nextAction();
|
return syncOfflineUsers(server, options);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
require(['contentuploader'], function () {
|
require(['contentuploader'], function () {
|
||||||
|
|
||||||
new MediaBrowser.ContentUploader(connectionManager).uploadImages(server).then(function () {
|
new MediaBrowser.ContentUploader(connectionManager).uploadImages(server).then(function () {
|
||||||
|
|
||||||
Logger.log("ContentUploaded succeeded to server: " + server.Id);
|
console.log("ContentUploaded succeeded to server: " + server.Id);
|
||||||
|
|
||||||
nextAction();
|
syncOfflineUsers(server, options).then(resolve, reject);
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
||||||
Logger.log("ContentUploaded failed to server: " + server.Id);
|
console.log("ContentUploaded failed to server: " + server.Id);
|
||||||
|
|
||||||
nextAction();
|
syncOfflineUsers(server, options).then(resolve, reject);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncOfflineUsers(server, options, deferred) {
|
function syncOfflineUsers(server, options) {
|
||||||
|
|
||||||
if (options.syncOfflineUsers === false) {
|
if (options.syncOfflineUsers === false) {
|
||||||
syncMedia(server, options, deferred);
|
return syncMedia(server, options);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
require(['offlineusersync'], function () {
|
require(['offlineusersync'], function () {
|
||||||
|
|
||||||
var apiClient = connectionManager.getApiClient(server.Id);
|
var apiClient = connectionManager.getApiClient(server.Id);
|
||||||
|
|
||||||
new MediaBrowser.OfflineUserSync().sync(apiClient, server).then(function () {
|
new MediaBrowser.OfflineUserSync().sync(apiClient, server).then(function () {
|
||||||
|
|
||||||
Logger.log("OfflineUserSync succeeded to server: " + server.Id);
|
console.log("OfflineUserSync succeeded to server: " + server.Id);
|
||||||
|
|
||||||
syncMedia(server, options, deferred);
|
syncMedia(server, options).then(resolve, reject);
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
||||||
Logger.log("OfflineUserSync failed to server: " + server.Id);
|
console.log("OfflineUserSync failed to server: " + server.Id);
|
||||||
|
|
||||||
deferred.reject();
|
reject();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncMedia(server, options, deferred) {
|
function syncMedia(server, options) {
|
||||||
|
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
require(['mediasync'], function () {
|
require(['mediasync'], function () {
|
||||||
|
|
||||||
|
@ -111,15 +111,16 @@
|
||||||
|
|
||||||
new MediaBrowser.MediaSync().sync(apiClient, server, options).then(function () {
|
new MediaBrowser.MediaSync().sync(apiClient, server, options).then(function () {
|
||||||
|
|
||||||
Logger.log("MediaSync succeeded to server: " + server.Id);
|
console.log("MediaSync succeeded to server: " + server.Id);
|
||||||
|
|
||||||
deferred.resolve();
|
resolve();
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
||||||
Logger.log("MediaSync failed to server: " + server.Id);
|
console.log("MediaSync failed to server: " + server.Id);
|
||||||
|
|
||||||
deferred.reject();
|
reject();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
{
|
{
|
||||||
"name": "hammerjs",
|
"name": "hammerjs",
|
||||||
"version": "2.0.4",
|
|
||||||
"main": "hammer.js",
|
"main": "hammer.js",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"tests",
|
"tests",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/hammerjs/hammer.js",
|
"homepage": "https://github.com/hammerjs/hammer.js",
|
||||||
"_release": "2.0.4",
|
"version": "2.0.5",
|
||||||
|
"_release": "2.0.5",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "2.0.4",
|
"tag": "v2.0.5",
|
||||||
"commit": "7fc11efb37d6f2334ce957e26e9cf53690e10fa5"
|
"commit": "4ac915029353faf7cbe3ac9252d84a2621772f85"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/hammerjs/hammer.js.git",
|
"_source": "git://github.com/hammerjs/hammer.js.git",
|
||||||
"_target": "~2.0.4",
|
"_target": "~2.0.4",
|
||||||
"_originalSource": "hammer.js",
|
"_originalSource": "hammer.js"
|
||||||
"_direct": true
|
|
||||||
}
|
}
|
91
dashboard-ui/bower_components/hammerjs/.jscsrc
vendored
91
dashboard-ui/bower_components/hammerjs/.jscsrc
vendored
|
@ -1,8 +1,95 @@
|
||||||
{
|
{
|
||||||
"preset": "google",
|
|
||||||
"excludeFiles": [
|
"excludeFiles": [
|
||||||
"*.js",
|
"*.js",
|
||||||
"tests/**/assets",
|
"tests/**/assets",
|
||||||
"node_modules/**"
|
"node_modules/**"
|
||||||
]
|
],
|
||||||
|
"requireCurlyBraces": [
|
||||||
|
"if",
|
||||||
|
"else",
|
||||||
|
"for",
|
||||||
|
"while",
|
||||||
|
"do",
|
||||||
|
"try",
|
||||||
|
"catch"
|
||||||
|
],
|
||||||
|
"requireOperatorBeforeLineBreak": true,
|
||||||
|
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||||
|
"maximumLineLength": {
|
||||||
|
"value": 120,
|
||||||
|
"allowComments": true,
|
||||||
|
"allowRegex": true
|
||||||
|
},
|
||||||
|
"validateIndentation": 4,
|
||||||
|
"validateQuoteMarks": "'",
|
||||||
|
"disallowMultipleLineStrings": true,
|
||||||
|
"disallowMixedSpacesAndTabs": true,
|
||||||
|
"disallowTrailingWhitespace": true,
|
||||||
|
"disallowSpaceAfterPrefixUnaryOperators": true,
|
||||||
|
"requireSpaceAfterKeywords": [
|
||||||
|
"if",
|
||||||
|
"else",
|
||||||
|
"for",
|
||||||
|
"while",
|
||||||
|
"do",
|
||||||
|
"switch",
|
||||||
|
"return",
|
||||||
|
"try",
|
||||||
|
"catch"
|
||||||
|
],
|
||||||
|
"requireSpaceBeforeBinaryOperators": [
|
||||||
|
"=",
|
||||||
|
"+=",
|
||||||
|
"-=",
|
||||||
|
"*=",
|
||||||
|
"/=",
|
||||||
|
"%=",
|
||||||
|
"<<=",
|
||||||
|
">>=",
|
||||||
|
">>>=",
|
||||||
|
"&=",
|
||||||
|
"|=",
|
||||||
|
"^=",
|
||||||
|
"+=",
|
||||||
|
"+",
|
||||||
|
"-",
|
||||||
|
"*",
|
||||||
|
"/",
|
||||||
|
"%",
|
||||||
|
"<<",
|
||||||
|
">>",
|
||||||
|
">>>",
|
||||||
|
"&",
|
||||||
|
"|",
|
||||||
|
"^",
|
||||||
|
"&&",
|
||||||
|
"||",
|
||||||
|
"===",
|
||||||
|
"==",
|
||||||
|
">=",
|
||||||
|
"<=",
|
||||||
|
"<",
|
||||||
|
">",
|
||||||
|
"!=",
|
||||||
|
"!=="
|
||||||
|
],
|
||||||
|
"requireSpaceAfterBinaryOperators": true,
|
||||||
|
"requireSpacesInConditionalExpression": true,
|
||||||
|
"requireSpaceBeforeBlockStatements": true,
|
||||||
|
"requireLineFeedAtFileEnd": true,
|
||||||
|
"requireSpacesInFunctionExpression": {
|
||||||
|
"beforeOpeningCurlyBrace": true
|
||||||
|
},
|
||||||
|
"disallowSpacesInAnonymousFunctionExpression": {
|
||||||
|
"beforeOpeningRoundBrace": true
|
||||||
|
},
|
||||||
|
"disallowSpacesInsideObjectBrackets": "all",
|
||||||
|
"disallowSpacesInsideArrayBrackets": "all",
|
||||||
|
"disallowSpacesInsideParentheses": true,
|
||||||
|
"validateJSDoc": {
|
||||||
|
"checkParamNames": true,
|
||||||
|
"requireParamTypes": true
|
||||||
|
},
|
||||||
|
"disallowMultipleLineBreaks": true,
|
||||||
|
"disallowNewlineBeforeBlockStatements": true
|
||||||
}
|
}
|
|
@ -2,6 +2,8 @@ language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.10"
|
- "0.10"
|
||||||
|
|
||||||
|
sudo: false
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- npm install -g grunt-cli
|
- npm install -g grunt-cli
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ module.exports = (grunt) ->
|
||||||
concat:
|
concat:
|
||||||
build:
|
build:
|
||||||
src: [
|
src: [
|
||||||
'src/hammer.prefix'
|
'src/hammer.prefix.js'
|
||||||
'src/utils.js'
|
'src/utils.js'
|
||||||
'src/input.js'
|
'src/input.js'
|
||||||
'src/input/*.js'
|
'src/input/*.js'
|
||||||
|
@ -29,7 +29,7 @@ module.exports = (grunt) ->
|
||||||
'src/hammer.js'
|
'src/hammer.js'
|
||||||
'src/manager.js'
|
'src/manager.js'
|
||||||
'src/expose.js'
|
'src/expose.js'
|
||||||
'src/hammer.suffix']
|
'src/hammer.suffix.js']
|
||||||
dest: 'hammer.js'
|
dest: 'hammer.js'
|
||||||
|
|
||||||
uglify:
|
uglify:
|
||||||
|
@ -80,8 +80,9 @@ module.exports = (grunt) ->
|
||||||
|
|
||||||
jscs:
|
jscs:
|
||||||
src: [
|
src: [
|
||||||
'src/**/*.js'
|
'src/**/*.js',
|
||||||
'tests/unit/*.js'
|
'!src/hammer.prefix.js',
|
||||||
|
'!src/hammer.suffix.js'
|
||||||
]
|
]
|
||||||
options:
|
options:
|
||||||
config: "./.jscsrc"
|
config: "./.jscsrc"
|
||||||
|
@ -113,7 +114,7 @@ module.exports = (grunt) ->
|
||||||
grunt.loadNpmTasks 'grunt-contrib-connect'
|
grunt.loadNpmTasks 'grunt-contrib-connect'
|
||||||
grunt.loadNpmTasks 'grunt-string-replace'
|
grunt.loadNpmTasks 'grunt-string-replace'
|
||||||
grunt.loadNpmTasks 'grunt-banner'
|
grunt.loadNpmTasks 'grunt-banner'
|
||||||
grunt.loadNpmTasks 'grunt-jscs-checker'
|
grunt.loadNpmTasks 'grunt-jscs'
|
||||||
|
|
||||||
# Default task(s)
|
# Default task(s)
|
||||||
grunt.registerTask 'default', ['connect', 'watch']
|
grunt.registerTask 'default', ['connect', 'watch']
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "hammerjs",
|
"name": "hammerjs",
|
||||||
"version": "2.0.4",
|
|
||||||
"main": "hammer.js",
|
"main": "hammer.js",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"tests",
|
"tests",
|
||||||
|
|
151
dashboard-ui/bower_components/hammerjs/hammer.js
vendored
151
dashboard-ui/bower_components/hammerjs/hammer.js
vendored
|
@ -1,12 +1,12 @@
|
||||||
/*! Hammer.JS - v2.0.4 - 2014-09-28
|
/*! Hammer.JS - v2.0.4 - 2015-12-22
|
||||||
* http://hammerjs.github.io/
|
* http://hammerjs.github.io/
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Jorik Tangelder;
|
* Copyright (c) 2015 Jorik Tangelder;
|
||||||
* Licensed under the MIT license */
|
* Licensed under the license */
|
||||||
(function(window, document, exportName, undefined) {
|
(function(window, document, exportName, undefined) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
|
var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
|
||||||
var TEST_ELEMENT = document.createElement('div');
|
var TEST_ELEMENT = document.createElement('div');
|
||||||
|
|
||||||
var TYPE_FUNCTION = 'function';
|
var TYPE_FUNCTION = 'function';
|
||||||
|
@ -320,8 +320,8 @@ function uniqueId() {
|
||||||
* @returns {DocumentView|Window}
|
* @returns {DocumentView|Window}
|
||||||
*/
|
*/
|
||||||
function getWindowForElement(element) {
|
function getWindowForElement(element) {
|
||||||
var doc = element.ownerDocument;
|
var doc = element.ownerDocument || element;
|
||||||
return (doc.defaultView || doc.parentWindow);
|
return (doc.defaultView || doc.parentWindow || window);
|
||||||
}
|
}
|
||||||
|
|
||||||
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
||||||
|
@ -500,9 +500,17 @@ function computeInputData(manager, input) {
|
||||||
computeDeltaXY(session, input);
|
computeDeltaXY(session, input);
|
||||||
input.offsetDirection = getDirection(input.deltaX, input.deltaY);
|
input.offsetDirection = getDirection(input.deltaX, input.deltaY);
|
||||||
|
|
||||||
|
var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
|
||||||
|
input.overallVelocityX = overallVelocity.x;
|
||||||
|
input.overallVelocityY = overallVelocity.y;
|
||||||
|
input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
|
||||||
|
|
||||||
input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
|
input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
|
||||||
input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
|
input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
|
||||||
|
|
||||||
|
input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
|
||||||
|
session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
|
||||||
|
|
||||||
computeIntervalInputData(session, input);
|
computeIntervalInputData(session, input);
|
||||||
|
|
||||||
// find the correct target
|
// find the correct target
|
||||||
|
@ -546,8 +554,8 @@ function computeIntervalInputData(session, input) {
|
||||||
velocity, velocityX, velocityY, direction;
|
velocity, velocityX, velocityY, direction;
|
||||||
|
|
||||||
if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
|
if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
|
||||||
var deltaX = last.deltaX - input.deltaX;
|
var deltaX = input.deltaX - last.deltaX;
|
||||||
var deltaY = last.deltaY - input.deltaY;
|
var deltaY = input.deltaY - last.deltaY;
|
||||||
|
|
||||||
var v = getVelocity(deltaTime, deltaX, deltaY);
|
var v = getVelocity(deltaTime, deltaX, deltaY);
|
||||||
velocityX = v.x;
|
velocityX = v.x;
|
||||||
|
@ -652,9 +660,9 @@ function getDirection(x, y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abs(x) >= abs(y)) {
|
if (abs(x) >= abs(y)) {
|
||||||
return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
||||||
}
|
}
|
||||||
return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -697,7 +705,7 @@ function getAngle(p1, p2, props) {
|
||||||
* @return {Number} rotation
|
* @return {Number} rotation
|
||||||
*/
|
*/
|
||||||
function getRotation(start, end) {
|
function getRotation(start, end) {
|
||||||
return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
|
return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -790,7 +798,7 @@ var POINTER_ELEMENT_EVENTS = 'pointerdown';
|
||||||
var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
|
var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
|
||||||
|
|
||||||
// IE10 has prefixed support, and case-sensitive
|
// IE10 has prefixed support, and case-sensitive
|
||||||
if (window.MSPointerEvent) {
|
if (window.MSPointerEvent && !window.PointerEvent) {
|
||||||
POINTER_ELEMENT_EVENTS = 'MSPointerDown';
|
POINTER_ELEMENT_EVENTS = 'MSPointerDown';
|
||||||
POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
|
POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
|
||||||
}
|
}
|
||||||
|
@ -1114,7 +1122,7 @@ TouchAction.prototype = {
|
||||||
value = this.compute();
|
value = this.compute();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NATIVE_TOUCH_ACTION) {
|
if (NATIVE_TOUCH_ACTION && this.manager.element.style) {
|
||||||
this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
|
this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
|
||||||
}
|
}
|
||||||
this.actions = value.toLowerCase().trim();
|
this.actions = value.toLowerCase().trim();
|
||||||
|
@ -1165,6 +1173,23 @@ TouchAction.prototype = {
|
||||||
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
|
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
|
||||||
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
||||||
|
|
||||||
|
if (hasNone) {
|
||||||
|
//do not prevent defaults if this is a tap gesture
|
||||||
|
|
||||||
|
var isTapPointer = input.pointers.length === 1;
|
||||||
|
var isTapMovement = input.distance < 2;
|
||||||
|
var isTapTouchTime = input.deltaTime < 250;
|
||||||
|
|
||||||
|
if (isTapPointer && isTapMovement && isTapTouchTime) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasPanX && hasPanY) {
|
||||||
|
// `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasNone ||
|
if (hasNone ||
|
||||||
(hasPanY && direction & DIRECTION_HORIZONTAL) ||
|
(hasPanY && direction & DIRECTION_HORIZONTAL) ||
|
||||||
(hasPanX && direction & DIRECTION_VERTICAL)) {
|
(hasPanX && direction & DIRECTION_VERTICAL)) {
|
||||||
|
@ -1196,9 +1221,12 @@ function cleanTouchActions(actions) {
|
||||||
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
||||||
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
|
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
|
||||||
|
|
||||||
// pan-x and pan-y can be combined
|
// if both pan-x and pan-y are set (different recognizers
|
||||||
|
// for different directions, e.g. horizontal pan but vertical swipe?)
|
||||||
|
// we need none (as otherwise with pan-x pan-y combined none of these
|
||||||
|
// recognizers will work, since the browser would handle all panning
|
||||||
if (hasPanX && hasPanY) {
|
if (hasPanX && hasPanY) {
|
||||||
return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
|
return TOUCH_ACTION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pan-x OR pan-y
|
// pan-x OR pan-y
|
||||||
|
@ -1256,10 +1284,13 @@ var STATE_FAILED = 32;
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
*/
|
*/
|
||||||
function Recognizer(options) {
|
function Recognizer(options) {
|
||||||
|
// make sure, options are copied over to a new object to prevent leaking it outside
|
||||||
|
options = extend({}, options || {});
|
||||||
|
|
||||||
this.id = uniqueId();
|
this.id = uniqueId();
|
||||||
|
|
||||||
this.manager = null;
|
this.manager = null;
|
||||||
this.options = merge(options || {}, this.defaults);
|
this.options = merge(options, this.defaults);
|
||||||
|
|
||||||
// default is enable true
|
// default is enable true
|
||||||
this.options.enable = ifUndefined(this.options.enable, true);
|
this.options.enable = ifUndefined(this.options.enable, true);
|
||||||
|
@ -1387,20 +1418,24 @@ Recognizer.prototype = {
|
||||||
var self = this;
|
var self = this;
|
||||||
var state = this.state;
|
var state = this.state;
|
||||||
|
|
||||||
function emit(withState) {
|
function emit(event) {
|
||||||
self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
|
self.manager.emit(event, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'panstart' and 'panmove'
|
// 'panstart' and 'panmove'
|
||||||
if (state < STATE_ENDED) {
|
if (state < STATE_ENDED) {
|
||||||
emit(true);
|
emit(self.options.event + stateStr(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
emit(); // simple 'eventName' events
|
emit(self.options.event); // simple 'eventName' events
|
||||||
|
|
||||||
|
if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
|
||||||
|
emit(input.additionalEvent);
|
||||||
|
}
|
||||||
|
|
||||||
// panend and pancancel
|
// panend and pancancel
|
||||||
if (state >= STATE_ENDED) {
|
if (state >= STATE_ENDED) {
|
||||||
emit(true);
|
emit(self.options.event + stateStr(state));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1665,14 +1700,15 @@ inherit(PanRecognizer, AttrRecognizer, {
|
||||||
},
|
},
|
||||||
|
|
||||||
emit: function(input) {
|
emit: function(input) {
|
||||||
|
|
||||||
this.pX = input.deltaX;
|
this.pX = input.deltaX;
|
||||||
this.pY = input.deltaY;
|
this.pY = input.deltaY;
|
||||||
|
|
||||||
var direction = directionStr(input.direction);
|
var direction = directionStr(input.direction);
|
||||||
if (direction) {
|
|
||||||
this.manager.emit(this.options.event + direction, input);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (direction) {
|
||||||
|
input.additionalEvent = this.options.event + direction;
|
||||||
|
}
|
||||||
this._super.emit.call(this, input);
|
this._super.emit.call(this, input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1708,11 +1744,11 @@ inherit(PinchRecognizer, AttrRecognizer, {
|
||||||
},
|
},
|
||||||
|
|
||||||
emit: function(input) {
|
emit: function(input) {
|
||||||
this._super.emit.call(this, input);
|
|
||||||
if (input.scale !== 1) {
|
if (input.scale !== 1) {
|
||||||
var inOut = input.scale < 1 ? 'in' : 'out';
|
var inOut = input.scale < 1 ? 'in' : 'out';
|
||||||
this.manager.emit(this.options.event + inOut, input);
|
input.additionalEvent = this.options.event + inOut;
|
||||||
}
|
}
|
||||||
|
this._super.emit.call(this, input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1737,8 +1773,8 @@ inherit(PressRecognizer, Recognizer, {
|
||||||
defaults: {
|
defaults: {
|
||||||
event: 'press',
|
event: 'press',
|
||||||
pointers: 1,
|
pointers: 1,
|
||||||
time: 500, // minimal time of the pointer to be pressed
|
time: 251, // minimal time of the pointer to be pressed
|
||||||
threshold: 5 // a minimal movement is ok, but keep it low
|
threshold: 9 // a minimal movement is ok, but keep it low
|
||||||
},
|
},
|
||||||
|
|
||||||
getTouchAction: function() {
|
getTouchAction: function() {
|
||||||
|
@ -1836,7 +1872,7 @@ inherit(SwipeRecognizer, AttrRecognizer, {
|
||||||
defaults: {
|
defaults: {
|
||||||
event: 'swipe',
|
event: 'swipe',
|
||||||
threshold: 10,
|
threshold: 10,
|
||||||
velocity: 0.65,
|
velocity: 0.3,
|
||||||
direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
|
direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
|
||||||
pointers: 1
|
pointers: 1
|
||||||
},
|
},
|
||||||
|
@ -1850,21 +1886,22 @@ inherit(SwipeRecognizer, AttrRecognizer, {
|
||||||
var velocity;
|
var velocity;
|
||||||
|
|
||||||
if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
|
if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
|
||||||
velocity = input.velocity;
|
velocity = input.overallVelocity;
|
||||||
} else if (direction & DIRECTION_HORIZONTAL) {
|
} else if (direction & DIRECTION_HORIZONTAL) {
|
||||||
velocity = input.velocityX;
|
velocity = input.overallVelocityX;
|
||||||
} else if (direction & DIRECTION_VERTICAL) {
|
} else if (direction & DIRECTION_VERTICAL) {
|
||||||
velocity = input.velocityY;
|
velocity = input.overallVelocityY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._super.attrTest.call(this, input) &&
|
return this._super.attrTest.call(this, input) &&
|
||||||
direction & input.direction &&
|
direction & input.offsetDirection &&
|
||||||
input.distance > this.options.threshold &&
|
input.distance > this.options.threshold &&
|
||||||
|
input.maxPointers == this.options.pointers &&
|
||||||
abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
|
abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
|
||||||
},
|
},
|
||||||
|
|
||||||
emit: function(input) {
|
emit: function(input) {
|
||||||
var direction = directionStr(input.direction);
|
var direction = directionStr(input.offsetDirection);
|
||||||
if (direction) {
|
if (direction) {
|
||||||
this.manager.emit(this.options.event + direction, input);
|
this.manager.emit(this.options.event + direction, input);
|
||||||
}
|
}
|
||||||
|
@ -1907,7 +1944,7 @@ inherit(TapRecognizer, Recognizer, {
|
||||||
taps: 1,
|
taps: 1,
|
||||||
interval: 300, // max time between the multi-tap taps
|
interval: 300, // max time between the multi-tap taps
|
||||||
time: 250, // max time of the pointer to be down (like finger on the screen)
|
time: 250, // max time of the pointer to be down (like finger on the screen)
|
||||||
threshold: 2, // a minimal movement is ok, but keep it low
|
threshold: 9, // a minimal movement is ok, but keep it low
|
||||||
posThreshold: 10 // a multi-tap can be a bit off the initial position
|
posThreshold: 10 // a multi-tap can be a bit off the initial position
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1981,7 +2018,7 @@ inherit(TapRecognizer, Recognizer, {
|
||||||
},
|
},
|
||||||
|
|
||||||
emit: function() {
|
emit: function() {
|
||||||
if (this.state == STATE_RECOGNIZED ) {
|
if (this.state == STATE_RECOGNIZED) {
|
||||||
this._input.tapCount = this.count;
|
this._input.tapCount = this.count;
|
||||||
this.manager.emit(this.options.event, this._input);
|
this.manager.emit(this.options.event, this._input);
|
||||||
}
|
}
|
||||||
|
@ -1989,7 +2026,7 @@ inherit(TapRecognizer, Recognizer, {
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple way to create an manager with a default set of recognizers.
|
* Simple way to create a manager with a default set of recognizers.
|
||||||
* @param {HTMLElement} element
|
* @param {HTMLElement} element
|
||||||
* @param {Object} [options]
|
* @param {Object} [options]
|
||||||
* @constructor
|
* @constructor
|
||||||
|
@ -2055,12 +2092,12 @@ Hammer.defaults = {
|
||||||
*/
|
*/
|
||||||
preset: [
|
preset: [
|
||||||
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
|
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
|
||||||
[RotateRecognizer, { enable: false }],
|
[RotateRecognizer, {enable: false}],
|
||||||
[PinchRecognizer, { enable: false }, ['rotate']],
|
[PinchRecognizer, {enable: false}, ['rotate']],
|
||||||
[SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }],
|
[SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
|
||||||
[PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']],
|
[PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
|
||||||
[TapRecognizer],
|
[TapRecognizer],
|
||||||
[TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']],
|
[TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
|
||||||
[PressRecognizer]
|
[PressRecognizer]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -2127,9 +2164,9 @@ var FORCED_STOP = 2;
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function Manager(element, options) {
|
function Manager(element, options) {
|
||||||
options = options || {};
|
var newOptions = options ? extend({}, options) : {};
|
||||||
|
this.options = merge(newOptions, Hammer.defaults);
|
||||||
|
|
||||||
this.options = merge(options, Hammer.defaults);
|
|
||||||
this.options.inputTarget = this.options.inputTarget || element;
|
this.options.inputTarget = this.options.inputTarget || element;
|
||||||
|
|
||||||
this.handlers = {};
|
this.handlers = {};
|
||||||
|
@ -2142,7 +2179,7 @@ function Manager(element, options) {
|
||||||
|
|
||||||
toggleCssProps(this, true);
|
toggleCssProps(this, true);
|
||||||
|
|
||||||
each(options.recognizers, function(item) {
|
each(this.options.recognizers, function(item) {
|
||||||
var recognizer = this.add(new (item[0])(item[1]));
|
var recognizer = this.add(new (item[0])(item[1]));
|
||||||
item[2] && recognizer.recognizeWith(item[2]);
|
item[2] && recognizer.recognizeWith(item[2]);
|
||||||
item[3] && recognizer.requireFailure(item[3]);
|
item[3] && recognizer.requireFailure(item[3]);
|
||||||
|
@ -2290,11 +2327,19 @@ Manager.prototype = {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
var recognizers = this.recognizers;
|
|
||||||
recognizer = this.get(recognizer);
|
recognizer = this.get(recognizer);
|
||||||
recognizers.splice(inArray(recognizers, recognizer), 1);
|
|
||||||
|
|
||||||
|
// let's make sure this recognizer exists
|
||||||
|
if (recognizer) {
|
||||||
|
var recognizers = this.recognizers;
|
||||||
|
var index = inArray(recognizers, recognizer);
|
||||||
|
|
||||||
|
if (index !== -1) {
|
||||||
|
recognizers.splice(index, 1);
|
||||||
this.touchAction.update();
|
this.touchAction.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2325,7 +2370,7 @@ Manager.prototype = {
|
||||||
if (!handler) {
|
if (!handler) {
|
||||||
delete handlers[event];
|
delete handlers[event];
|
||||||
} else {
|
} else {
|
||||||
handlers[event].splice(inArray(handlers[event], handler), 1);
|
handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
|
@ -2381,6 +2426,9 @@ Manager.prototype = {
|
||||||
*/
|
*/
|
||||||
function toggleCssProps(manager, add) {
|
function toggleCssProps(manager, add) {
|
||||||
var element = manager.element;
|
var element = manager.element;
|
||||||
|
if (!element.style) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
each(manager.options.cssProps, function(value, name) {
|
each(manager.options.cssProps, function(value, name) {
|
||||||
element.style[prefixed(element.style, name)] = add ? value : '';
|
element.style[prefixed(element.style, name)] = add ? value : '';
|
||||||
});
|
});
|
||||||
|
@ -2450,7 +2498,12 @@ extend(Hammer, {
|
||||||
prefixed: prefixed
|
prefixed: prefixed
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof define == TYPE_FUNCTION && define.amd) {
|
// this prevents errors when Hammer is loaded in the presence of an AMD
|
||||||
|
// style loader but by script tag, not by the loader.
|
||||||
|
var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
|
||||||
|
freeGlobal.Hammer = Hammer;
|
||||||
|
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
define(function() {
|
define(function() {
|
||||||
return Hammer;
|
return Hammer;
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,14 +2,9 @@
|
||||||
"name": "hammerjs",
|
"name": "hammerjs",
|
||||||
"title": "Hammer.JS",
|
"title": "Hammer.JS",
|
||||||
"description": "A javascript library for multi-touch gestures",
|
"description": "A javascript library for multi-touch gestures",
|
||||||
"version": "2.0.4",
|
"version": "2.0.5",
|
||||||
"homepage": "http://hammerjs.github.io/",
|
"homepage": "http://hammerjs.github.io/",
|
||||||
"licenses": [
|
"license": "MIT",
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/hammerjs/hammer.js/blob/master/LICENSE.md"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"touch",
|
"touch",
|
||||||
"gestures"
|
"gestures"
|
||||||
|
@ -35,9 +30,9 @@
|
||||||
"grunt-contrib-qunit": "^0.5.1",
|
"grunt-contrib-qunit": "^0.5.1",
|
||||||
"grunt-contrib-uglify": "0.4.x",
|
"grunt-contrib-uglify": "0.4.x",
|
||||||
"grunt-contrib-watch": "0.6.x",
|
"grunt-contrib-watch": "0.6.x",
|
||||||
"grunt-jscs-checker": "^0.4.1",
|
"grunt-jscs": "^0.8.0",
|
||||||
"grunt-string-replace": "^0.2.7",
|
"grunt-string-replace": "^0.2.7",
|
||||||
"hammer-jquery": "git://github.com/hammerjs/jquery.hammer.js#master",
|
"jquery-hammerjs": "2.0.x",
|
||||||
"hammer-simulator": "git://github.com/hammerjs/simulator#master"
|
"hammer-simulator": "git://github.com/hammerjs/simulator#master"
|
||||||
},
|
},
|
||||||
"main": "hammer.js",
|
"main": "hammer.js",
|
||||||
|
|
11
dashboard-ui/bower_components/hls.js/.bower.json
vendored
11
dashboard-ui/bower_components/hls.js/.bower.json
vendored
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hls.js",
|
"name": "hls.js",
|
||||||
"version": "0.3.11",
|
"version": "0.3.15",
|
||||||
"description": "Media Source Extension - HLS library, by/for Dailymotion",
|
"description": "Media Source Extension - HLS library, by/for Dailymotion",
|
||||||
"homepage": "https://github.com/dailymotion/hls.js",
|
"homepage": "https://github.com/dailymotion/hls.js",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
@ -15,14 +15,13 @@
|
||||||
"test",
|
"test",
|
||||||
"tests"
|
"tests"
|
||||||
],
|
],
|
||||||
"_release": "0.3.11",
|
"_release": "0.3.15",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v0.3.11",
|
"tag": "v0.3.15",
|
||||||
"commit": "4e698e4adc4e1e0fa80ef9c8334a5ef382bbe347"
|
"commit": "d3ecf55b89063d7ba3bd70800d5839755b0c7e63"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/dailymotion/hls.js.git",
|
"_source": "git://github.com/dailymotion/hls.js.git",
|
||||||
"_target": "~0.3.11",
|
"_target": "~0.3.11",
|
||||||
"_originalSource": "dailymotion/hls.js",
|
"_originalSource": "dailymotion/hls.js"
|
||||||
"_direct": true
|
|
||||||
}
|
}
|
4
dashboard-ui/bower_components/hls.js/API.md
vendored
4
dashboard-ui/bower_components/hls.js/API.md
vendored
|
@ -197,7 +197,7 @@ configuration parameters could be provided to hls.js upon instantiation of Hls O
|
||||||
manifestLoadingRetryDelay : 500,
|
manifestLoadingRetryDelay : 500,
|
||||||
fpsDroppedMonitoringPeriod : 5000,
|
fpsDroppedMonitoringPeriod : 5000,
|
||||||
fpsDroppedMonitoringThreshold : 0.2,
|
fpsDroppedMonitoringThreshold : 0.2,
|
||||||
appendErrorMaxRetry : 200,
|
appendErrorMaxRetry : 3,
|
||||||
loader : customLoader,
|
loader : customLoader,
|
||||||
fLoader: customFragmentLoader,
|
fLoader: customFragmentLoader,
|
||||||
pLoader: customPlaylistLoader,
|
pLoader: customPlaylistLoader,
|
||||||
|
@ -275,7 +275,7 @@ any I/O error will trigger retries every 500ms,1s,2s,4s,8s, ... capped to 64s (e
|
||||||
|
|
||||||
max nb of append retry
|
max nb of append retry
|
||||||
#### ```appendErrorMaxRetry```
|
#### ```appendErrorMaxRetry```
|
||||||
(default 200)
|
(default 3)
|
||||||
|
|
||||||
max number of sourceBuffer.appendBuffer() retry upon error.
|
max number of sourceBuffer.appendBuffer() retry upon error.
|
||||||
such error could happen in loop with UHD streams, when internal buffer is full. (Quota Exceeding Error will be triggered). in that case we need to wait for the browser to evict some data before being able to append buffer correctly.
|
such error could happen in loop with UHD streams, when internal buffer is full. (Quota Exceeding Error will be triggered). in that case we need to wait for the browser to evict some data before being able to append buffer correctly.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hls.js",
|
"name": "hls.js",
|
||||||
"version": "0.3.11",
|
"version": "0.3.15",
|
||||||
"description": "Media Source Extension - HLS library, by/for Dailymotion",
|
"description": "Media Source Extension - HLS library, by/for Dailymotion",
|
||||||
"homepage": "https://github.com/dailymotion/hls.js",
|
"homepage": "https://github.com/dailymotion/hls.js",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|
|
@ -72,8 +72,9 @@ header {
|
||||||
<div id="customButtons"></div>
|
<div id="customButtons"></div>
|
||||||
<select id="streamSelect" class="innerControls"><option value="" selected>(Enter custom URL below)</option></select>
|
<select id="streamSelect" class="innerControls"><option value="" selected>(Enter custom URL below)</option></select>
|
||||||
<input id="streamURL" class="innerControls" type=text value=""/>
|
<input id="streamURL" class="innerControls" type=text value=""/>
|
||||||
<label class="innerControls"><input id="enableStream" type=checkbox checked/> Enable Streaming</label>
|
<label class="innerControls"><input id="enableStreaming" type=checkbox checked/> Enable Streaming</label>
|
||||||
<label class="innerControls"><input id="autoRecoverError" type=checkbox checked/> Auto-Recover Media Error</label>
|
<label class="innerControls"><input id="autoRecoverError" type=checkbox checked/> Auto-Recover Media Error</label>
|
||||||
|
<label class="innerControls"><input id="enableWorker" type=checkbox checked/> Enable Worker</label>
|
||||||
<div id="StreamPermalink" class="innerControls"></div>
|
<div id="StreamPermalink" class="innerControls"></div>
|
||||||
<div>
|
<div>
|
||||||
<select id="videoSize" style="float:left">
|
<select id="videoSize" style="float:left">
|
||||||
|
@ -201,21 +202,25 @@ $(document).ready(function() {
|
||||||
$("#StatsDisplay").hide();
|
$("#StatsDisplay").hide();
|
||||||
$('#metricsButtonWindow').toggle(windowSliding);
|
$('#metricsButtonWindow').toggle(windowSliding);
|
||||||
$('#metricsButtonFixed').toggle(!windowSliding);
|
$('#metricsButtonFixed').toggle(!windowSliding);
|
||||||
$('#enableStream').click(function() { enableStreaming = this.checked; loadStream($('#streamURL').val());});
|
$('#enableStreaming').click(function() { enableStreaming = this.checked; loadStream($('#streamURL').val()); });
|
||||||
$('#autoRecoverError').prop( "checked", true );
|
$('#autoRecoverError').click(function() { autoRecoverError = this.checked; updatePermalink();});
|
||||||
$('#autoRecoverError').click(function() { autoRecoverError = this.checked; });
|
$('#enableWorker').click(function() { enableWorker = this.checked; updatePermalink();});
|
||||||
|
$('#enableStreaming').prop( "checked", enableStreaming );
|
||||||
|
$('#autoRecoverError').prop( "checked", autoRecoverError );
|
||||||
|
$('#enableWorker').prop( "checked", enableWorker );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
var hls,events, stats, enableStreaming = true, autoRecoverError = true;
|
var hls,events, stats,
|
||||||
|
enableStreaming = JSON.parse(getURLParam('enableStreaming',true))
|
||||||
|
autoRecoverError = JSON.parse(getURLParam('autoRecoverError',true)),
|
||||||
|
enableWorker = JSON.parse(getURLParam('enableWorker',true));
|
||||||
var video = $('#video')[0];
|
var video = $('#video')[0];
|
||||||
video.volume = 0.05;
|
video.volume = 0.05;
|
||||||
|
|
||||||
var manifest = decodeURIComponent(location.search.split('src=')[1]);
|
loadStream(decodeURIComponent(getURLParam('src','http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8')));
|
||||||
if(manifest === 'undefined') {
|
|
||||||
manifest = 'http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8';
|
|
||||||
}
|
|
||||||
loadStream(manifest);
|
|
||||||
|
|
||||||
function loadStream(url) {
|
function loadStream(url) {
|
||||||
hideCanvas();
|
hideCanvas();
|
||||||
|
@ -230,10 +235,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#streamURL').val(url);
|
$('#streamURL').val(url);
|
||||||
var hlsLink = document.URL.split('?')[0] + '?src=' + encodeURIComponent(url);
|
updatePermalink();
|
||||||
var description = 'permalink: ' + "<a href=\"" + hlsLink + "\">" + hlsLink + "</a>";
|
|
||||||
$("#StreamPermalink").html(description);
|
|
||||||
|
|
||||||
if(!enableStreaming) {
|
if(!enableStreaming) {
|
||||||
$("#HlsStatus").text("Streaming disabled");
|
$("#HlsStatus").text("Streaming disabled");
|
||||||
return;
|
return;
|
||||||
|
@ -242,7 +244,7 @@ $(document).ready(function() {
|
||||||
$("#HlsStatus").text('loading ' + url);
|
$("#HlsStatus").text('loading ' + url);
|
||||||
events = { url : url, t0 : performance.now(), load : [], buffer : [], video : [], level : [], bitrate : []};
|
events = { url : url, t0 : performance.now(), load : [], buffer : [], video : [], level : [], bitrate : []};
|
||||||
recoverDecodingErrorDate = recoverSwapAudioCodecDate = null;
|
recoverDecodingErrorDate = recoverSwapAudioCodecDate = null;
|
||||||
hls = new Hls({debug:true});
|
hls = new Hls({debug:true, enableWorker : enableWorker});
|
||||||
$("#HlsStatus").text('loading manifest and attaching video element...');
|
$("#HlsStatus").text('loading manifest and attaching video element...');
|
||||||
hls.loadSource(url);
|
hls.loadSource(url);
|
||||||
hls.attachMedia(video);
|
hls.attachMedia(video);
|
||||||
|
@ -470,6 +472,7 @@ $(document).ready(function() {
|
||||||
hls.destroy();
|
hls.destroy();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
console.log($("#HlsStatus").text());
|
||||||
}
|
}
|
||||||
if(!stats) stats = {};
|
if(!stats) stats = {};
|
||||||
// track all errors independently
|
// track all errors independently
|
||||||
|
@ -908,6 +911,25 @@ function timeRangesToString(r) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getURLParam(sParam, defaultValue) {
|
||||||
|
var sPageURL = window.location.search.substring(1);
|
||||||
|
var sURLVariables = sPageURL.split('&');
|
||||||
|
for (var i = 0; i < sURLVariables.length; i++) {
|
||||||
|
var sParameterName = sURLVariables[i].split('=');
|
||||||
|
if (sParameterName[0] == sParam) {
|
||||||
|
return sParameterName[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePermalink() {
|
||||||
|
var url = $('#streamURL').val();
|
||||||
|
var hlsLink = document.URL.split('?')[0] + '?src=' + encodeURIComponent(url) + '&enableStreaming=' + enableStreaming + '&autoRecoverError=' + autoRecoverError + '&enableWorker=' + enableWorker;
|
||||||
|
var description = 'permalink: ' + "<a href=\"" + hlsLink + "\">" + hlsLink + "</a>";
|
||||||
|
$("#StreamPermalink").html(description);
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
133
dashboard-ui/bower_components/hls.js/dist/hls.js
vendored
133
dashboard-ui/bower_components/hls.js/dist/hls.js
vendored
|
@ -532,7 +532,8 @@ var LevelController = (function () {
|
||||||
i,
|
i,
|
||||||
bitrateSet = {},
|
bitrateSet = {},
|
||||||
videoCodecFound = false,
|
videoCodecFound = false,
|
||||||
audioCodecFound = false;
|
audioCodecFound = false,
|
||||||
|
hls = this.hls;
|
||||||
|
|
||||||
// regroup redundant level together
|
// regroup redundant level together
|
||||||
data.levels.forEach(function (level) {
|
data.levels.forEach(function (level) {
|
||||||
|
@ -565,16 +566,17 @@ var LevelController = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// only keep level with supported audio/video codecs
|
// only keep level with supported audio/video codecs
|
||||||
levels0 = levels0.filter(function (level) {
|
levels = levels.filter(function (level) {
|
||||||
var checkSupported = function checkSupported(codec) {
|
var checkSupported = function checkSupported(codec) {
|
||||||
return MediaSource.isTypeSupported('video/mp4;codecs=' + codec);
|
return MediaSource.isTypeSupported('video/mp4;codecs=' + codec);
|
||||||
};
|
};
|
||||||
var audioCodec = level.audioCodec,
|
var audioCodec = level.audioCodec,
|
||||||
videoCodec = level.videoCodec;
|
videoCodec = level.videoCodec;
|
||||||
|
|
||||||
return (audioCodec && checkSupported(audioCodec) || !audioCodec) && (videoCodec && checkSupported(videoCodec) || !videoCodec);
|
return (!audioCodec || checkSupported(audioCodec)) && (!videoCodec || checkSupported(videoCodec));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (levels.length) {
|
||||||
// start bitrate is the first bitrate of the manifest
|
// start bitrate is the first bitrate of the manifest
|
||||||
bitrateStart = levels[0].bitrate;
|
bitrateStart = levels[0].bitrate;
|
||||||
// sort level on bitrate
|
// sort level on bitrate
|
||||||
|
@ -590,7 +592,10 @@ var LevelController = (function () {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.hls.trigger(_events2['default'].MANIFEST_PARSED, { levels: this._levels, firstLevel: this._firstLevel, stats: data.stats });
|
hls.trigger(_events2['default'].MANIFEST_PARSED, { levels: this._levels, firstLevel: this._firstLevel, stats: data.stats });
|
||||||
|
} else {
|
||||||
|
hls.trigger(_events2['default'].ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: hls.url, reason: 'no compatible level found in manifest' });
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
@ -648,7 +653,8 @@ var LevelController = (function () {
|
||||||
}
|
}
|
||||||
/* try to switch to a redundant stream if any available.
|
/* try to switch to a redundant stream if any available.
|
||||||
* if no redundant stream available, emergency switch down (if in auto mode and current level not 0)
|
* if no redundant stream available, emergency switch down (if in auto mode and current level not 0)
|
||||||
* otherwise, we cannot recover this network error ....
|
* otherwise, we cannot recover this network error ...
|
||||||
|
* don't raise FRAG_LOAD_ERROR and FRAG_LOAD_TIMEOUT as fatal, as it is handled by mediaController
|
||||||
*/
|
*/
|
||||||
if (levelId !== undefined) {
|
if (levelId !== undefined) {
|
||||||
level = this._levels[levelId];
|
level = this._levels[levelId];
|
||||||
|
@ -664,7 +670,8 @@ var LevelController = (function () {
|
||||||
hls.abrController.nextAutoLevel = 0;
|
hls.abrController.nextAutoLevel = 0;
|
||||||
} else if (level && level.details && level.details.live) {
|
} else if (level && level.details && level.details.live) {
|
||||||
_utilsLogger.logger.warn('level controller,' + details + ' on live stream, discard');
|
_utilsLogger.logger.warn('level controller,' + details + ' on live stream, discard');
|
||||||
} else {
|
// FRAG_LOAD_ERROR and FRAG_LOAD_TIMEOUT are handled by mediaController
|
||||||
|
} else if (details !== _errors.ErrorDetails.FRAG_LOAD_ERROR && details !== _errors.ErrorDetails.FRAG_LOAD_TIMEOUT) {
|
||||||
_utilsLogger.logger.error('cannot recover ' + details + ' error');
|
_utilsLogger.logger.error('cannot recover ' + details + ' error');
|
||||||
this._level = undefined;
|
this._level = undefined;
|
||||||
// stopping live reloading timer if any
|
// stopping live reloading timer if any
|
||||||
|
@ -1194,8 +1201,11 @@ var MSEMediaController = (function () {
|
||||||
this.appendError = 0;
|
this.appendError = 0;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// in case any error occured while appending, put back segment in mp4segments table
|
// in case any error occured while appending, put back segment in mp4segments table
|
||||||
//logger.error(`error while trying to append buffer:${err.message},try appending later`);
|
_utilsLogger.logger.error('error while trying to append buffer:' + err.message + ',try appending later');
|
||||||
this.mp4segments.unshift(segment);
|
this.mp4segments.unshift(segment);
|
||||||
|
// just discard QuotaExceededError for now, and wait for the natural browser buffer eviction
|
||||||
|
//http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror
|
||||||
|
if (err.code !== 22) {
|
||||||
if (this.appendError) {
|
if (this.appendError) {
|
||||||
this.appendError++;
|
this.appendError++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1216,6 +1226,7 @@ var MSEMediaController = (function () {
|
||||||
hls.trigger(_events2['default'].ERROR, event);
|
hls.trigger(_events2['default'].ERROR, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.state = State.APPENDING;
|
this.state = State.APPENDING;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1807,6 +1818,7 @@ var MSEMediaController = (function () {
|
||||||
this.demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata);
|
this.demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.fragLoadError = 0;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'onInitSegment',
|
key: 'onInitSegment',
|
||||||
|
@ -1905,6 +1917,24 @@ var MSEMediaController = (function () {
|
||||||
// abort fragment loading on errors
|
// abort fragment loading on errors
|
||||||
case _errors.ErrorDetails.FRAG_LOAD_ERROR:
|
case _errors.ErrorDetails.FRAG_LOAD_ERROR:
|
||||||
case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:
|
case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:
|
||||||
|
var loadError = this.fragLoadError;
|
||||||
|
if (loadError) {
|
||||||
|
loadError++;
|
||||||
|
} else {
|
||||||
|
loadError = 1;
|
||||||
|
}
|
||||||
|
if (loadError <= this.config.fragLoadingMaxRetry) {
|
||||||
|
this.fragLoadError = loadError;
|
||||||
|
// retry loading
|
||||||
|
this.state = State.IDLE;
|
||||||
|
} else {
|
||||||
|
_utilsLogger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');
|
||||||
|
// redispatch same error but with fatal set to true
|
||||||
|
data.fatal = true;
|
||||||
|
this.hls.trigger(event, data);
|
||||||
|
this.state = State.ERROR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:
|
case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:
|
||||||
case _errors.ErrorDetails.LEVEL_LOAD_ERROR:
|
case _errors.ErrorDetails.LEVEL_LOAD_ERROR:
|
||||||
case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:
|
case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:
|
||||||
|
@ -2691,7 +2721,7 @@ var AACDemuxer = (function () {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.remuxer.remux(this._aacTrack, { samples: [] }, { samples: [] }, timeOffset);
|
this.remuxer.remux(this._aacTrack, { samples: [] }, { samples: [{ pts: pts, dts: pts, unit: id3.payload }] }, timeOffset);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: '_ADTStoAudioConfig',
|
key: '_ADTStoAudioConfig',
|
||||||
|
@ -3570,6 +3600,7 @@ var ID3 = (function () {
|
||||||
_utilsLogger.logger.warn('ID3 tag found, but no timestamp');
|
_utilsLogger.logger.warn('ID3 tag found, but no timestamp');
|
||||||
}
|
}
|
||||||
this._length = len;
|
this._length = len;
|
||||||
|
this._payload = data.subarray(0, len);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3646,6 +3677,11 @@ var ID3 = (function () {
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return this._length;
|
return this._length;
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: 'payload',
|
||||||
|
get: function get() {
|
||||||
|
return this._payload;
|
||||||
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return ID3;
|
return ID3;
|
||||||
|
@ -4746,7 +4782,7 @@ var Hls = (function () {
|
||||||
enableWorker: true,
|
enableWorker: true,
|
||||||
enableSoftwareAES: true,
|
enableSoftwareAES: true,
|
||||||
fragLoadingTimeOut: 20000,
|
fragLoadingTimeOut: 20000,
|
||||||
fragLoadingMaxRetry: 1,
|
fragLoadingMaxRetry: 6,
|
||||||
fragLoadingRetryDelay: 1000,
|
fragLoadingRetryDelay: 1000,
|
||||||
fragLoadingLoopThreshold: 3,
|
fragLoadingLoopThreshold: 3,
|
||||||
manifestLoadingTimeOut: 10000,
|
manifestLoadingTimeOut: 10000,
|
||||||
|
@ -4754,7 +4790,7 @@ var Hls = (function () {
|
||||||
manifestLoadingRetryDelay: 1000,
|
manifestLoadingRetryDelay: 1000,
|
||||||
// fpsDroppedMonitoringPeriod: 5000,
|
// fpsDroppedMonitoringPeriod: 5000,
|
||||||
// fpsDroppedMonitoringThreshold: 0.2,
|
// fpsDroppedMonitoringThreshold: 0.2,
|
||||||
appendErrorMaxRetry: 200,
|
appendErrorMaxRetry: 3,
|
||||||
loader: _utilsXhrLoader2['default'],
|
loader: _utilsXhrLoader2['default'],
|
||||||
fLoader: undefined,
|
fLoader: undefined,
|
||||||
pLoader: undefined,
|
pLoader: undefined,
|
||||||
|
@ -5038,7 +5074,7 @@ var FragmentLoader = (function () {
|
||||||
this.frag.loaded = 0;
|
this.frag.loaded = 0;
|
||||||
var config = this.hls.config;
|
var config = this.hls.config;
|
||||||
frag.loader = this.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);
|
frag.loader = this.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);
|
||||||
this.loader.load(frag.url, 'arraybuffer', this.loadsuccess.bind(this), this.loaderror.bind(this), this.loadtimeout.bind(this), config.fragLoadingTimeOut, config.fragLoadingMaxRetry, config.fragLoadingRetryDelay, this.loadprogress.bind(this), frag);
|
this.loader.load(frag.url, 'arraybuffer', this.loadsuccess.bind(this), this.loaderror.bind(this), this.loadtimeout.bind(this), config.fragLoadingTimeOut, 1, config.fragLoadingRetryDelay, this.loadprogress.bind(this), frag);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'loadsuccess',
|
key: 'loadsuccess',
|
||||||
|
@ -5301,7 +5337,7 @@ var PlaylistLoader = (function () {
|
||||||
if (avcdata.length > 2) {
|
if (avcdata.length > 2) {
|
||||||
result = avcdata.shift() + '.';
|
result = avcdata.shift() + '.';
|
||||||
result += parseInt(avcdata.shift()).toString(16);
|
result += parseInt(avcdata.shift()).toString(16);
|
||||||
result += ('00' + parseInt(avcdata.shift()).toString(16)).substr(-4);
|
result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);
|
||||||
} else {
|
} else {
|
||||||
result = codec;
|
result = codec;
|
||||||
}
|
}
|
||||||
|
@ -5651,6 +5687,7 @@ var MP4 = (function () {
|
||||||
var payload = Array.prototype.slice.call(arguments, 1),
|
var payload = Array.prototype.slice.call(arguments, 1),
|
||||||
size = 0,
|
size = 0,
|
||||||
i = payload.length,
|
i = payload.length,
|
||||||
|
len = i,
|
||||||
result,
|
result,
|
||||||
view;
|
view;
|
||||||
// calculate the total size we need to allocate
|
// calculate the total size we need to allocate
|
||||||
|
@ -5662,7 +5699,7 @@ var MP4 = (function () {
|
||||||
view.setUint32(0, result.byteLength);
|
view.setUint32(0, result.byteLength);
|
||||||
result.set(type, 4);
|
result.set(type, 4);
|
||||||
// copy the payload into the result
|
// copy the payload into the result
|
||||||
for (i = 0, size = 8; i < payload.length; i++) {
|
for (i = 0, size = 8; i < len; i++) {
|
||||||
result.set(payload[i], size);
|
result.set(payload[i], size);
|
||||||
size += payload[i].byteLength;
|
size += payload[i].byteLength;
|
||||||
}
|
}
|
||||||
|
@ -5818,7 +5855,10 @@ var MP4 = (function () {
|
||||||
0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes
|
0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes
|
||||||
0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets
|
0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets
|
||||||
].concat(sps).concat([track.pps.length // numOfPictureParameterSets
|
].concat(sps).concat([track.pps.length // numOfPictureParameterSets
|
||||||
]).concat(pps))); // "PPS"
|
]).concat(pps))),
|
||||||
|
// "PPS"
|
||||||
|
width = track.width,
|
||||||
|
height = track.height;
|
||||||
//console.log('avcc:' + Hex.hexDump(avcc));
|
//console.log('avcc:' + Hex.hexDump(avcc));
|
||||||
return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved
|
return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved
|
||||||
0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, // reserved
|
||||||
|
@ -5826,8 +5866,8 @@ var MP4 = (function () {
|
||||||
0x00, 0x00, // pre_defined
|
0x00, 0x00, // pre_defined
|
||||||
0x00, 0x00, // reserved
|
0x00, 0x00, // reserved
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined
|
||||||
track.width >> 8 & 0xFF, track.width & 0xff, // width
|
width >> 8 & 0xFF, width & 0xff, // width
|
||||||
track.height >> 8 & 0xFF, track.height & 0xff, // height
|
height >> 8 & 0xFF, height & 0xff, // height
|
||||||
0x00, 0x48, 0x00, 0x00, // horizresolution
|
0x00, 0x48, 0x00, 0x00, // horizresolution
|
||||||
0x00, 0x48, 0x00, 0x00, // vertresolution
|
0x00, 0x48, 0x00, 0x00, // vertresolution
|
||||||
0x00, 0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, 0x00, // reserved
|
||||||
|
@ -5843,16 +5883,17 @@ var MP4 = (function () {
|
||||||
}, {
|
}, {
|
||||||
key: 'esds',
|
key: 'esds',
|
||||||
value: function esds(track) {
|
value: function esds(track) {
|
||||||
|
var configlen = track.config.length;
|
||||||
return new Uint8Array([0x00, // version 0
|
return new Uint8Array([0x00, // version 0
|
||||||
0x00, 0x00, 0x00, // flags
|
0x00, 0x00, 0x00, // flags
|
||||||
|
|
||||||
0x03, // descriptor_type
|
0x03, // descriptor_type
|
||||||
0x17 + track.config.length, // length
|
0x17 + configlen, // length
|
||||||
0x00, 0x01, //es_id
|
0x00, 0x01, //es_id
|
||||||
0x00, // stream_priority
|
0x00, // stream_priority
|
||||||
|
|
||||||
0x04, // descriptor_type
|
0x04, // descriptor_type
|
||||||
0x0f + track.config.length, // length
|
0x0f + configlen, // length
|
||||||
0x40, //codec : mpeg4_audio
|
0x40, //codec : mpeg4_audio
|
||||||
0x15, // stream_type
|
0x15, // stream_type
|
||||||
0x00, 0x00, 0x00, // buffer_size
|
0x00, 0x00, 0x00, // buffer_size
|
||||||
|
@ -5860,11 +5901,12 @@ var MP4 = (function () {
|
||||||
0x00, 0x00, 0x00, 0x00, // avgBitrate
|
0x00, 0x00, 0x00, 0x00, // avgBitrate
|
||||||
|
|
||||||
0x05 // descriptor_type
|
0x05 // descriptor_type
|
||||||
].concat([track.config.length]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor
|
].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'mp4a',
|
key: 'mp4a',
|
||||||
value: function mp4a(track) {
|
value: function mp4a(track) {
|
||||||
|
var audiosamplerate = track.audiosamplerate;
|
||||||
return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved
|
return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved
|
||||||
0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, // reserved
|
||||||
0x00, 0x01, // data_reference_index
|
0x00, 0x01, // data_reference_index
|
||||||
|
@ -5872,7 +5914,7 @@ var MP4 = (function () {
|
||||||
0x00, track.channelCount, // channelcount
|
0x00, track.channelCount, // channelcount
|
||||||
0x00, 0x10, // sampleSize:16bits
|
0x00, 0x10, // sampleSize:16bits
|
||||||
0x00, 0x00, 0x00, 0x00, // reserved2
|
0x00, 0x00, 0x00, 0x00, // reserved2
|
||||||
track.audiosamplerate >> 8 & 0xFF, track.audiosamplerate & 0xff, //
|
audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //
|
||||||
0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));
|
0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
@ -5887,30 +5929,35 @@ var MP4 = (function () {
|
||||||
}, {
|
}, {
|
||||||
key: 'tkhd',
|
key: 'tkhd',
|
||||||
value: function tkhd(track) {
|
value: function tkhd(track) {
|
||||||
|
var id = track.id,
|
||||||
|
duration = track.duration,
|
||||||
|
width = track.width,
|
||||||
|
height = track.height;
|
||||||
return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0
|
return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0
|
||||||
0x00, 0x00, 0x07, // flags
|
0x00, 0x00, 0x07, // flags
|
||||||
0x00, 0x00, 0x00, 0x00, // creation_time
|
0x00, 0x00, 0x00, 0x00, // creation_time
|
||||||
0x00, 0x00, 0x00, 0x00, // modification_time
|
0x00, 0x00, 0x00, 0x00, // modification_time
|
||||||
track.id >> 24 & 0xFF, track.id >> 16 & 0xFF, track.id >> 8 & 0xFF, track.id & 0xFF, // track_ID
|
id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID
|
||||||
0x00, 0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, 0x00, // reserved
|
||||||
track.duration >> 24, track.duration >> 16 & 0xFF, track.duration >> 8 & 0xFF, track.duration & 0xFF, // duration
|
duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
|
||||||
0x00, 0x00, // layer
|
0x00, 0x00, // layer
|
||||||
0x00, 0x00, // alternate_group
|
0x00, 0x00, // alternate_group
|
||||||
0x00, 0x00, // non-audio track volume
|
0x00, 0x00, // non-audio track volume
|
||||||
0x00, 0x00, // reserved
|
0x00, 0x00, // reserved
|
||||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
|
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
|
||||||
track.width >> 8 & 0xFF, track.width & 0xFF, 0x00, 0x00, // width
|
width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width
|
||||||
track.height >> 8 & 0xFF, track.height & 0xFF, 0x00, 0x00 // height
|
height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'traf',
|
key: 'traf',
|
||||||
value: function traf(track, baseMediaDecodeTime) {
|
value: function traf(track, baseMediaDecodeTime) {
|
||||||
var sampleDependencyTable = MP4.sdtp(track);
|
var sampleDependencyTable = MP4.sdtp(track),
|
||||||
|
id = track.id;
|
||||||
return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0
|
return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0
|
||||||
0x00, 0x00, 0x00, // flags
|
0x00, 0x00, 0x00, // flags
|
||||||
track.id >> 24, track.id >> 16 & 0XFF, track.id >> 8 & 0XFF, track.id & 0xFF])), // track_ID
|
id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), // track_ID
|
||||||
MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0
|
MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0
|
||||||
0x00, 0x00, 0x00, // flags
|
0x00, 0x00, 0x00, // flags
|
||||||
baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), // baseMediaDecodeTime
|
baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), // baseMediaDecodeTime
|
||||||
|
@ -5937,9 +5984,10 @@ var MP4 = (function () {
|
||||||
}, {
|
}, {
|
||||||
key: 'trex',
|
key: 'trex',
|
||||||
value: function trex(track) {
|
value: function trex(track) {
|
||||||
|
var id = track.id;
|
||||||
return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0
|
return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0
|
||||||
0x00, 0x00, 0x00, // flags
|
0x00, 0x00, 0x00, // flags
|
||||||
track.id >> 24, track.id >> 16 & 0XFF, track.id >> 8 & 0XFF, track.id & 0xFF, // track_ID
|
id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID
|
||||||
0x00, 0x00, 0x00, 0x01, // default_sample_description_index
|
0x00, 0x00, 0x00, 0x01, // default_sample_description_index
|
||||||
0x00, 0x00, 0x00, 0x00, // default_sample_duration
|
0x00, 0x00, 0x00, 0x00, // default_sample_duration
|
||||||
0x00, 0x00, 0x00, 0x00, // default_sample_size
|
0x00, 0x00, 0x00, 0x00, // default_sample_size
|
||||||
|
@ -5949,21 +5997,32 @@ var MP4 = (function () {
|
||||||
}, {
|
}, {
|
||||||
key: 'trun',
|
key: 'trun',
|
||||||
value: function trun(track, offset) {
|
value: function trun(track, offset) {
|
||||||
var samples, sample, i, array;
|
var samples = track.samples || [],
|
||||||
samples = track.samples || [];
|
len = samples.length,
|
||||||
array = new Uint8Array(12 + 16 * samples.length);
|
arraylen = 12 + 16 * len,
|
||||||
offset += 8 + array.byteLength;
|
array = new Uint8Array(arraylen),
|
||||||
|
i,
|
||||||
|
sample,
|
||||||
|
duration,
|
||||||
|
size,
|
||||||
|
flags,
|
||||||
|
cts;
|
||||||
|
offset += 8 + arraylen;
|
||||||
array.set([0x00, // version 0
|
array.set([0x00, // version 0
|
||||||
0x00, 0x0f, 0x01, // flags
|
0x00, 0x0f, 0x01, // flags
|
||||||
samples.length >>> 24 & 0xFF, samples.length >>> 16 & 0xFF, samples.length >>> 8 & 0xFF, samples.length & 0xFF, // sample_count
|
len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count
|
||||||
offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset
|
offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset
|
||||||
], 0);
|
], 0);
|
||||||
for (i = 0; i < samples.length; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
sample = samples[i];
|
sample = samples[i];
|
||||||
array.set([sample.duration >>> 24 & 0xFF, sample.duration >>> 16 & 0xFF, sample.duration >>> 8 & 0xFF, sample.duration & 0xFF, // sample_duration
|
duration = sample.duration;
|
||||||
sample.size >>> 24 & 0xFF, sample.size >>> 16 & 0xFF, sample.size >>> 8 & 0xFF, sample.size & 0xFF, // sample_size
|
size = sample.size;
|
||||||
sample.flags.isLeading << 2 | sample.flags.dependsOn, sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSync, sample.flags.degradPrio & 0xF0 << 8, sample.flags.degradPrio & 0x0F, // sample_flags
|
flags = sample.flags;
|
||||||
sample.cts >>> 24 & 0xFF, sample.cts >>> 16 & 0xFF, sample.cts >>> 8 & 0xFF, sample.cts & 0xFF // sample_composition_time_offset
|
cts = sample.cts;
|
||||||
|
array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration
|
||||||
|
size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size
|
||||||
|
flags.isLeading << 2 | sample.flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags
|
||||||
|
cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset
|
||||||
], 12 + 16 * i);
|
], 12 + 16 * i);
|
||||||
}
|
}
|
||||||
return MP4.box(MP4.types.trun, array);
|
return MP4.box(MP4.types.trun, array);
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hls.js",
|
"name": "hls.js",
|
||||||
"version": "0.3.11",
|
"version": "0.3.15",
|
||||||
"description": "Media Source Extension - HLS library, by/for Dailymotion",
|
"description": "Media Source Extension - HLS library, by/for Dailymotion",
|
||||||
"homepage": "https://github.com/dailymotion/hls.js",
|
"homepage": "https://github.com/dailymotion/hls.js",
|
||||||
"authors": "Guillaume du Pontavice <guillaume.dupontavice@dailymotion.com>",
|
"authors": "Guillaume du Pontavice <guillaume.dupontavice@dailymotion.com>",
|
||||||
|
|
|
@ -32,7 +32,7 @@ class LevelController {
|
||||||
}
|
}
|
||||||
|
|
||||||
onManifestLoaded(event, data) {
|
onManifestLoaded(event, data) {
|
||||||
var levels0 = [], levels = [], bitrateStart, i, bitrateSet = {}, videoCodecFound = false, audioCodecFound = false;
|
var levels0 = [], levels = [], bitrateStart, i, bitrateSet = {}, videoCodecFound = false, audioCodecFound = false, hls = this.hls;
|
||||||
|
|
||||||
// regroup redundant level together
|
// regroup redundant level together
|
||||||
data.levels.forEach(level => {
|
data.levels.forEach(level => {
|
||||||
|
@ -65,15 +65,15 @@ class LevelController {
|
||||||
}
|
}
|
||||||
|
|
||||||
// only keep level with supported audio/video codecs
|
// only keep level with supported audio/video codecs
|
||||||
levels0 = levels0.filter(function(level) {
|
levels = levels.filter(function(level) {
|
||||||
var checkSupported = function(codec) { return MediaSource.isTypeSupported(`video/mp4;codecs=${codec}`);};
|
var checkSupported = function(codec) { return MediaSource.isTypeSupported(`video/mp4;codecs=${codec}`);};
|
||||||
var audioCodec = level.audioCodec, videoCodec = level.videoCodec;
|
var audioCodec = level.audioCodec, videoCodec = level.videoCodec;
|
||||||
|
|
||||||
return ((audioCodec && checkSupported(audioCodec)) || !audioCodec) &&
|
return (!audioCodec || checkSupported(audioCodec)) &&
|
||||||
((videoCodec && checkSupported(videoCodec)) || !videoCodec);
|
(!videoCodec || checkSupported(videoCodec));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(levels.length) {
|
||||||
// start bitrate is the first bitrate of the manifest
|
// start bitrate is the first bitrate of the manifest
|
||||||
bitrateStart = levels[0].bitrate;
|
bitrateStart = levels[0].bitrate;
|
||||||
// sort level on bitrate
|
// sort level on bitrate
|
||||||
|
@ -89,7 +89,10 @@ class LevelController {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.hls.trigger(Event.MANIFEST_PARSED, {levels: this._levels, firstLevel: this._firstLevel, stats: data.stats});
|
hls.trigger(Event.MANIFEST_PARSED, {levels: this._levels, firstLevel: this._firstLevel, stats: data.stats});
|
||||||
|
} else {
|
||||||
|
hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: hls.url, reason: 'no compatible level found in manifest'});
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +190,8 @@ class LevelController {
|
||||||
}
|
}
|
||||||
/* try to switch to a redundant stream if any available.
|
/* try to switch to a redundant stream if any available.
|
||||||
* if no redundant stream available, emergency switch down (if in auto mode and current level not 0)
|
* if no redundant stream available, emergency switch down (if in auto mode and current level not 0)
|
||||||
* otherwise, we cannot recover this network error ....
|
* otherwise, we cannot recover this network error ...
|
||||||
|
* don't raise FRAG_LOAD_ERROR and FRAG_LOAD_TIMEOUT as fatal, as it is handled by mediaController
|
||||||
*/
|
*/
|
||||||
if (levelId !== undefined) {
|
if (levelId !== undefined) {
|
||||||
level = this._levels[levelId];
|
level = this._levels[levelId];
|
||||||
|
@ -203,7 +207,8 @@ class LevelController {
|
||||||
hls.abrController.nextAutoLevel = 0;
|
hls.abrController.nextAutoLevel = 0;
|
||||||
} else if(level && level.details && level.details.live) {
|
} else if(level && level.details && level.details.live) {
|
||||||
logger.warn(`level controller,${details} on live stream, discard`);
|
logger.warn(`level controller,${details} on live stream, discard`);
|
||||||
} else {
|
// FRAG_LOAD_ERROR and FRAG_LOAD_TIMEOUT are handled by mediaController
|
||||||
|
} else if (details !== ErrorDetails.FRAG_LOAD_ERROR && details !== ErrorDetails.FRAG_LOAD_TIMEOUT) {
|
||||||
logger.error(`cannot recover ${details} error`);
|
logger.error(`cannot recover ${details} error`);
|
||||||
this._level = undefined;
|
this._level = undefined;
|
||||||
// stopping live reloading timer if any
|
// stopping live reloading timer if any
|
||||||
|
|
|
@ -391,8 +391,11 @@ class MSEMediaController {
|
||||||
this.appendError = 0;
|
this.appendError = 0;
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
// in case any error occured while appending, put back segment in mp4segments table
|
// in case any error occured while appending, put back segment in mp4segments table
|
||||||
//logger.error(`error while trying to append buffer:${err.message},try appending later`);
|
logger.error(`error while trying to append buffer:${err.message},try appending later`);
|
||||||
this.mp4segments.unshift(segment);
|
this.mp4segments.unshift(segment);
|
||||||
|
// just discard QuotaExceededError for now, and wait for the natural browser buffer eviction
|
||||||
|
//http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror
|
||||||
|
if(err.code !== 22) {
|
||||||
if (this.appendError) {
|
if (this.appendError) {
|
||||||
this.appendError++;
|
this.appendError++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -413,6 +416,7 @@ class MSEMediaController {
|
||||||
hls.trigger(Event.ERROR, event);
|
hls.trigger(Event.ERROR, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.state = State.APPENDING;
|
this.state = State.APPENDING;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1000,6 +1004,7 @@ class MSEMediaController {
|
||||||
this.demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata);
|
this.demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.fragLoadError = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
onInitSegment(event, data) {
|
onInitSegment(event, data) {
|
||||||
|
@ -1095,6 +1100,24 @@ class MSEMediaController {
|
||||||
// abort fragment loading on errors
|
// abort fragment loading on errors
|
||||||
case ErrorDetails.FRAG_LOAD_ERROR:
|
case ErrorDetails.FRAG_LOAD_ERROR:
|
||||||
case ErrorDetails.FRAG_LOAD_TIMEOUT:
|
case ErrorDetails.FRAG_LOAD_TIMEOUT:
|
||||||
|
var loadError = this.fragLoadError;
|
||||||
|
if(loadError) {
|
||||||
|
loadError++;
|
||||||
|
} else {
|
||||||
|
loadError=1;
|
||||||
|
}
|
||||||
|
if (loadError <= this.config.fragLoadingMaxRetry) {
|
||||||
|
this.fragLoadError = loadError;
|
||||||
|
// retry loading
|
||||||
|
this.state = State.IDLE;
|
||||||
|
} else {
|
||||||
|
logger.error(`mediaController: ${data.details} reaches max retry, redispatch as fatal ...`);
|
||||||
|
// redispatch same error but with fatal set to true
|
||||||
|
data.fatal = true;
|
||||||
|
this.hls.trigger(event, data);
|
||||||
|
this.state = State.ERROR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ErrorDetails.FRAG_LOOP_LOADING_ERROR:
|
case ErrorDetails.FRAG_LOOP_LOADING_ERROR:
|
||||||
case ErrorDetails.LEVEL_LOAD_ERROR:
|
case ErrorDetails.LEVEL_LOAD_ERROR:
|
||||||
case ErrorDetails.LEVEL_LOAD_TIMEOUT:
|
case ErrorDetails.LEVEL_LOAD_TIMEOUT:
|
||||||
|
|
|
@ -79,7 +79,7 @@ import {ErrorTypes, ErrorDetails} from '../errors';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.remuxer.remux(this._aacTrack,{samples : []}, {samples : []}, timeOffset);
|
this.remuxer.remux(this._aacTrack,{samples : []}, {samples : [ { pts: pts, dts : pts, unit : id3.payload} ]}, timeOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ADTStoAudioConfig(data, offset, audioCodec) {
|
_ADTStoAudioConfig(data, offset, audioCodec) {
|
||||||
|
|
|
@ -41,6 +41,7 @@ import {logger} from '../utils/logger';
|
||||||
logger.warn('ID3 tag found, but no timestamp');
|
logger.warn('ID3 tag found, but no timestamp');
|
||||||
}
|
}
|
||||||
this._length = len;
|
this._length = len;
|
||||||
|
this._payload = data.subarray(0,len);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -117,6 +118,10 @@ import {logger} from '../utils/logger';
|
||||||
return this._length;
|
return this._length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get payload() {
|
||||||
|
return this._payload;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ID3;
|
export default ID3;
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Hls {
|
||||||
enableWorker: true,
|
enableWorker: true,
|
||||||
enableSoftwareAES: true,
|
enableSoftwareAES: true,
|
||||||
fragLoadingTimeOut: 20000,
|
fragLoadingTimeOut: 20000,
|
||||||
fragLoadingMaxRetry: 1,
|
fragLoadingMaxRetry: 6,
|
||||||
fragLoadingRetryDelay: 1000,
|
fragLoadingRetryDelay: 1000,
|
||||||
fragLoadingLoopThreshold: 3,
|
fragLoadingLoopThreshold: 3,
|
||||||
manifestLoadingTimeOut: 10000,
|
manifestLoadingTimeOut: 10000,
|
||||||
|
@ -54,7 +54,7 @@ class Hls {
|
||||||
manifestLoadingRetryDelay: 1000,
|
manifestLoadingRetryDelay: 1000,
|
||||||
// fpsDroppedMonitoringPeriod: 5000,
|
// fpsDroppedMonitoringPeriod: 5000,
|
||||||
// fpsDroppedMonitoringThreshold: 0.2,
|
// fpsDroppedMonitoringThreshold: 0.2,
|
||||||
appendErrorMaxRetry: 200,
|
appendErrorMaxRetry: 3,
|
||||||
loader: XhrLoader,
|
loader: XhrLoader,
|
||||||
fLoader: undefined,
|
fLoader: undefined,
|
||||||
pLoader: undefined,
|
pLoader: undefined,
|
||||||
|
|
|
@ -27,7 +27,7 @@ class FragmentLoader {
|
||||||
this.frag.loaded = 0;
|
this.frag.loaded = 0;
|
||||||
var config = this.hls.config;
|
var config = this.hls.config;
|
||||||
frag.loader = this.loader = typeof(config.fLoader) !== 'undefined' ? new config.fLoader(config) : new config.loader(config);
|
frag.loader = this.loader = typeof(config.fLoader) !== 'undefined' ? new config.fLoader(config) : new config.loader(config);
|
||||||
this.loader.load(frag.url, 'arraybuffer', this.loadsuccess.bind(this), this.loaderror.bind(this), this.loadtimeout.bind(this), config.fragLoadingTimeOut, config.fragLoadingMaxRetry, config.fragLoadingRetryDelay, this.loadprogress.bind(this), frag);
|
this.loader.load(frag.url, 'arraybuffer', this.loadsuccess.bind(this), this.loaderror.bind(this), this.loadtimeout.bind(this), config.fragLoadingTimeOut, 1, config.fragLoadingRetryDelay, this.loadprogress.bind(this), frag);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadsuccess(event, stats) {
|
loadsuccess(event, stats) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ class PlaylistLoader {
|
||||||
if (avcdata.length > 2) {
|
if (avcdata.length > 2) {
|
||||||
result = avcdata.shift() + '.';
|
result = avcdata.shift() + '.';
|
||||||
result += parseInt(avcdata.shift()).toString(16);
|
result += parseInt(avcdata.shift()).toString(16);
|
||||||
result += ('00' + parseInt(avcdata.shift()).toString(16)).substr(-4);
|
result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);
|
||||||
} else {
|
} else {
|
||||||
result = codec;
|
result = codec;
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,7 @@ class MP4 {
|
||||||
payload = Array.prototype.slice.call(arguments, 1),
|
payload = Array.prototype.slice.call(arguments, 1),
|
||||||
size = 0,
|
size = 0,
|
||||||
i = payload.length,
|
i = payload.length,
|
||||||
|
len = i,
|
||||||
result,
|
result,
|
||||||
view;
|
view;
|
||||||
// calculate the total size we need to allocate
|
// calculate the total size we need to allocate
|
||||||
|
@ -163,7 +164,7 @@ class MP4 {
|
||||||
view.setUint32(0, result.byteLength);
|
view.setUint32(0, result.byteLength);
|
||||||
result.set(type, 4);
|
result.set(type, 4);
|
||||||
// copy the payload into the result
|
// copy the payload into the result
|
||||||
for (i = 0, size = 8; i < payload.length; i++) {
|
for (i = 0, size = 8; i < len; i++) {
|
||||||
result.set(payload[i], size);
|
result.set(payload[i], size);
|
||||||
size += payload[i].byteLength;
|
size += payload[i].byteLength;
|
||||||
}
|
}
|
||||||
|
@ -341,7 +342,9 @@ class MP4 {
|
||||||
0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets
|
0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets
|
||||||
].concat(sps).concat([
|
].concat(sps).concat([
|
||||||
track.pps.length // numOfPictureParameterSets
|
track.pps.length // numOfPictureParameterSets
|
||||||
]).concat(pps))); // "PPS"
|
]).concat(pps))), // "PPS"
|
||||||
|
width = track.width,
|
||||||
|
height = track.height;
|
||||||
//console.log('avcc:' + Hex.hexDump(avcc));
|
//console.log('avcc:' + Hex.hexDump(avcc));
|
||||||
return MP4.box(MP4.types.avc1, new Uint8Array([
|
return MP4.box(MP4.types.avc1, new Uint8Array([
|
||||||
0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, // reserved
|
||||||
|
@ -352,10 +355,10 @@ class MP4 {
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, // pre_defined
|
0x00, 0x00, 0x00, 0x00, // pre_defined
|
||||||
(track.width >> 8) & 0xFF,
|
(width >> 8) & 0xFF,
|
||||||
track.width & 0xff, // width
|
width & 0xff, // width
|
||||||
(track.height >> 8) & 0xFF,
|
(height >> 8) & 0xFF,
|
||||||
track.height & 0xff, // height
|
height & 0xff, // height
|
||||||
0x00, 0x48, 0x00, 0x00, // horizresolution
|
0x00, 0x48, 0x00, 0x00, // horizresolution
|
||||||
0x00, 0x48, 0x00, 0x00, // vertresolution
|
0x00, 0x48, 0x00, 0x00, // vertresolution
|
||||||
0x00, 0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, 0x00, // reserved
|
||||||
|
@ -380,17 +383,18 @@ class MP4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
static esds(track) {
|
static esds(track) {
|
||||||
|
var configlen = track.config.length;
|
||||||
return new Uint8Array([
|
return new Uint8Array([
|
||||||
0x00, // version 0
|
0x00, // version 0
|
||||||
0x00, 0x00, 0x00, // flags
|
0x00, 0x00, 0x00, // flags
|
||||||
|
|
||||||
0x03, // descriptor_type
|
0x03, // descriptor_type
|
||||||
0x17+track.config.length, // length
|
0x17+configlen, // length
|
||||||
0x00, 0x01, //es_id
|
0x00, 0x01, //es_id
|
||||||
0x00, // stream_priority
|
0x00, // stream_priority
|
||||||
|
|
||||||
0x04, // descriptor_type
|
0x04, // descriptor_type
|
||||||
0x0f+track.config.length, // length
|
0x0f+configlen, // length
|
||||||
0x40, //codec : mpeg4_audio
|
0x40, //codec : mpeg4_audio
|
||||||
0x15, // stream_type
|
0x15, // stream_type
|
||||||
0x00, 0x00, 0x00, // buffer_size
|
0x00, 0x00, 0x00, // buffer_size
|
||||||
|
@ -398,10 +402,11 @@ class MP4 {
|
||||||
0x00, 0x00, 0x00, 0x00, // avgBitrate
|
0x00, 0x00, 0x00, 0x00, // avgBitrate
|
||||||
|
|
||||||
0x05 // descriptor_type
|
0x05 // descriptor_type
|
||||||
].concat([track.config.length]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor
|
].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor
|
||||||
}
|
}
|
||||||
|
|
||||||
static mp4a(track) {
|
static mp4a(track) {
|
||||||
|
var audiosamplerate = track.audiosamplerate;
|
||||||
return MP4.box(MP4.types.mp4a, new Uint8Array([
|
return MP4.box(MP4.types.mp4a, new Uint8Array([
|
||||||
0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, // reserved
|
||||||
0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, // reserved
|
||||||
|
@ -411,8 +416,8 @@ class MP4 {
|
||||||
0x00, track.channelCount, // channelcount
|
0x00, track.channelCount, // channelcount
|
||||||
0x00, 0x10, // sampleSize:16bits
|
0x00, 0x10, // sampleSize:16bits
|
||||||
0x00, 0x00, 0x00, 0x00, // reserved2
|
0x00, 0x00, 0x00, 0x00, // reserved2
|
||||||
(track.audiosamplerate >> 8) & 0xFF,
|
(audiosamplerate >> 8) & 0xFF,
|
||||||
track.audiosamplerate & 0xff, //
|
audiosamplerate & 0xff, //
|
||||||
0x00, 0x00]),
|
0x00, 0x00]),
|
||||||
MP4.box(MP4.types.esds, MP4.esds(track)));
|
MP4.box(MP4.types.esds, MP4.esds(track)));
|
||||||
}
|
}
|
||||||
|
@ -426,20 +431,24 @@ class MP4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
static tkhd(track) {
|
static tkhd(track) {
|
||||||
|
var id = track.id,
|
||||||
|
duration = track.duration,
|
||||||
|
width = track.width,
|
||||||
|
height = track.height;
|
||||||
return MP4.box(MP4.types.tkhd, new Uint8Array([
|
return MP4.box(MP4.types.tkhd, new Uint8Array([
|
||||||
0x00, // version 0
|
0x00, // version 0
|
||||||
0x00, 0x00, 0x07, // flags
|
0x00, 0x00, 0x07, // flags
|
||||||
0x00, 0x00, 0x00, 0x00, // creation_time
|
0x00, 0x00, 0x00, 0x00, // creation_time
|
||||||
0x00, 0x00, 0x00, 0x00, // modification_time
|
0x00, 0x00, 0x00, 0x00, // modification_time
|
||||||
(track.id >> 24) & 0xFF,
|
(id >> 24) & 0xFF,
|
||||||
(track.id >> 16) & 0xFF,
|
(id >> 16) & 0xFF,
|
||||||
(track.id >> 8) & 0xFF,
|
(id >> 8) & 0xFF,
|
||||||
track.id & 0xFF, // track_ID
|
id & 0xFF, // track_ID
|
||||||
0x00, 0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, 0x00, // reserved
|
||||||
(track.duration >> 24),
|
(duration >> 24),
|
||||||
(track.duration >> 16) & 0xFF,
|
(duration >> 16) & 0xFF,
|
||||||
(track.duration >> 8) & 0xFF,
|
(duration >> 8) & 0xFF,
|
||||||
track.duration & 0xFF, // duration
|
duration & 0xFF, // duration
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, // reserved
|
0x00, 0x00, 0x00, 0x00, // reserved
|
||||||
0x00, 0x00, // layer
|
0x00, 0x00, // layer
|
||||||
|
@ -455,25 +464,26 @@ class MP4 {
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00,
|
||||||
0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
|
0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
|
||||||
(track.width >> 8) & 0xFF,
|
(width >> 8) & 0xFF,
|
||||||
track.width & 0xFF,
|
width & 0xFF,
|
||||||
0x00, 0x00, // width
|
0x00, 0x00, // width
|
||||||
(track.height >> 8) & 0xFF,
|
(height >> 8) & 0xFF,
|
||||||
track.height & 0xFF,
|
height & 0xFF,
|
||||||
0x00, 0x00 // height
|
0x00, 0x00 // height
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
static traf(track,baseMediaDecodeTime) {
|
static traf(track,baseMediaDecodeTime) {
|
||||||
var sampleDependencyTable = MP4.sdtp(track);
|
var sampleDependencyTable = MP4.sdtp(track),
|
||||||
|
id = track.id;
|
||||||
return MP4.box(MP4.types.traf,
|
return MP4.box(MP4.types.traf,
|
||||||
MP4.box(MP4.types.tfhd, new Uint8Array([
|
MP4.box(MP4.types.tfhd, new Uint8Array([
|
||||||
0x00, // version 0
|
0x00, // version 0
|
||||||
0x00, 0x00, 0x00, // flags
|
0x00, 0x00, 0x00, // flags
|
||||||
(track.id >> 24),
|
(id >> 24),
|
||||||
(track.id >> 16) & 0XFF,
|
(id >> 16) & 0XFF,
|
||||||
(track.id >> 8) & 0XFF,
|
(id >> 8) & 0XFF,
|
||||||
(track.id & 0xFF) // track_ID
|
(id & 0xFF) // track_ID
|
||||||
])),
|
])),
|
||||||
MP4.box(MP4.types.tfdt, new Uint8Array([
|
MP4.box(MP4.types.tfdt, new Uint8Array([
|
||||||
0x00, // version 0
|
0x00, // version 0
|
||||||
|
@ -505,13 +515,14 @@ class MP4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
static trex(track) {
|
static trex(track) {
|
||||||
|
var id = track.id;
|
||||||
return MP4.box(MP4.types.trex, new Uint8Array([
|
return MP4.box(MP4.types.trex, new Uint8Array([
|
||||||
0x00, // version 0
|
0x00, // version 0
|
||||||
0x00, 0x00, 0x00, // flags
|
0x00, 0x00, 0x00, // flags
|
||||||
(track.id >> 24),
|
(id >> 24),
|
||||||
(track.id >> 16) & 0XFF,
|
(id >> 16) & 0XFF,
|
||||||
(track.id >> 8) & 0XFF,
|
(id >> 8) & 0XFF,
|
||||||
(track.id & 0xFF), // track_ID
|
(id & 0xFF), // track_ID
|
||||||
0x00, 0x00, 0x00, 0x01, // default_sample_description_index
|
0x00, 0x00, 0x00, 0x01, // default_sample_description_index
|
||||||
0x00, 0x00, 0x00, 0x00, // default_sample_duration
|
0x00, 0x00, 0x00, 0x00, // default_sample_duration
|
||||||
0x00, 0x00, 0x00, 0x00, // default_sample_size
|
0x00, 0x00, 0x00, 0x00, // default_sample_size
|
||||||
|
@ -520,44 +531,50 @@ class MP4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
static trun(track, offset) {
|
static trun(track, offset) {
|
||||||
var samples, sample, i, array;
|
var samples= track.samples || [],
|
||||||
samples = track.samples || [];
|
len = samples.length,
|
||||||
array = new Uint8Array(12 + (16 * samples.length));
|
arraylen = 12 + (16 * len),
|
||||||
offset += 8 + array.byteLength;
|
array = new Uint8Array(arraylen),
|
||||||
|
i,sample,duration,size,flags,cts;
|
||||||
|
offset += 8 + arraylen;
|
||||||
array.set([
|
array.set([
|
||||||
0x00, // version 0
|
0x00, // version 0
|
||||||
0x00, 0x0f, 0x01, // flags
|
0x00, 0x0f, 0x01, // flags
|
||||||
(samples.length >>> 24) & 0xFF,
|
(len >>> 24) & 0xFF,
|
||||||
(samples.length >>> 16) & 0xFF,
|
(len >>> 16) & 0xFF,
|
||||||
(samples.length >>> 8) & 0xFF,
|
(len >>> 8) & 0xFF,
|
||||||
samples.length & 0xFF, // sample_count
|
len & 0xFF, // sample_count
|
||||||
(offset >>> 24) & 0xFF,
|
(offset >>> 24) & 0xFF,
|
||||||
(offset >>> 16) & 0xFF,
|
(offset >>> 16) & 0xFF,
|
||||||
(offset >>> 8) & 0xFF,
|
(offset >>> 8) & 0xFF,
|
||||||
offset & 0xFF // data_offset
|
offset & 0xFF // data_offset
|
||||||
],0);
|
],0);
|
||||||
for (i = 0; i < samples.length; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
sample = samples[i];
|
sample = samples[i];
|
||||||
|
duration = sample.duration;
|
||||||
|
size = sample.size;
|
||||||
|
flags = sample.flags;
|
||||||
|
cts = sample.cts;
|
||||||
array.set([
|
array.set([
|
||||||
(sample.duration >>> 24) & 0xFF,
|
(duration >>> 24) & 0xFF,
|
||||||
(sample.duration >>> 16) & 0xFF,
|
(duration >>> 16) & 0xFF,
|
||||||
(sample.duration >>> 8) & 0xFF,
|
(duration >>> 8) & 0xFF,
|
||||||
sample.duration & 0xFF, // sample_duration
|
duration & 0xFF, // sample_duration
|
||||||
(sample.size >>> 24) & 0xFF,
|
(size >>> 24) & 0xFF,
|
||||||
(sample.size >>> 16) & 0xFF,
|
(size >>> 16) & 0xFF,
|
||||||
(sample.size >>> 8) & 0xFF,
|
(size >>> 8) & 0xFF,
|
||||||
sample.size & 0xFF, // sample_size
|
size & 0xFF, // sample_size
|
||||||
(sample.flags.isLeading << 2) | sample.flags.dependsOn,
|
(flags.isLeading << 2) | sample.flags.dependsOn,
|
||||||
(sample.flags.isDependedOn << 6) |
|
(flags.isDependedOn << 6) |
|
||||||
(sample.flags.hasRedundancy << 4) |
|
(flags.hasRedundancy << 4) |
|
||||||
(sample.flags.paddingValue << 1) |
|
(flags.paddingValue << 1) |
|
||||||
sample.flags.isNonSync,
|
flags.isNonSync,
|
||||||
sample.flags.degradPrio & 0xF0 << 8,
|
flags.degradPrio & 0xF0 << 8,
|
||||||
sample.flags.degradPrio & 0x0F, // sample_flags
|
flags.degradPrio & 0x0F, // sample_flags
|
||||||
(sample.cts >>> 24) & 0xFF,
|
(cts >>> 24) & 0xFF,
|
||||||
(sample.cts >>> 16) & 0xFF,
|
(cts >>> 16) & 0xFF,
|
||||||
(sample.cts >>> 8) & 0xFF,
|
(cts >>> 8) & 0xFF,
|
||||||
sample.cts & 0xFF // sample_composition_time_offset
|
cts & 0xFF // sample_composition_time_offset
|
||||||
],12+16*i);
|
],12+16*i);
|
||||||
}
|
}
|
||||||
return MP4.box(MP4.types.trun, array);
|
return MP4.box(MP4.types.trun, array);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-checked-element-behavior",
|
"name": "iron-checked-element-behavior",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"description": "Implements an element that has a checked attribute and can be added to a form",
|
"description": "Implements an element that has a checked attribute and can be added to a form",
|
||||||
"authors": "The Polymer Authors",
|
"authors": "The Polymer Authors",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -31,11 +31,11 @@
|
||||||
"web-component-tester": "*",
|
"web-component-tester": "*",
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"_release": "1.0.3",
|
"_release": "1.0.4",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.3",
|
"tag": "v1.0.4",
|
||||||
"commit": "5a0520d20eb8883076ce64117f2726ba209ebc97"
|
"commit": "cc30263ec2871ae8f8f944948f44299d3f3cdf0d"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-checked-element-behavior.git",
|
"_source": "git://github.com/PolymerElements/iron-checked-element-behavior.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
|
|
|
@ -1,28 +1,22 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
sudo: false
|
sudo: false
|
||||||
matrix:
|
before_script:
|
||||||
include:
|
- npm install web-component-tester
|
||||||
- node_js: stable
|
- npm install bower
|
||||||
script: xvfb-run wct
|
- 'export PATH=$PWD/node_modules/.bin:$PATH'
|
||||||
addons:
|
- bower install
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- secure: EJSBYkW/C3ppDTbxHYRzyFPAko5R1ET1LSbdM484/j0OHGLkSIwtKrrZLNz5+QEmKSw79MpLpBoD+SfXuSCn0yKkf6tvK4mt+kRs32vKVfoWrYReVcfth+EWV7QDpTDJw1QEijT1bKUxULhP0OrT2/5vVpKpXX2zczg+VFL7IZuY3y1dsA4qWmWTfMiAk3762dZx47D5qzJ4POHlpG0i/cHH2EgqV8sFXFBctf6EY68GqzStPUuMuea6xX2wMrebg6vqQDfDb1gs8N34gxGE+u8QaqOSniW1Vzdoe1vwOUo4dbJYw3JMYK5Qn2pj3p2E4m9J609JNnBfqjS7mB5KVC7Hf5r9ul3UMsAIlOnlmSqOq1oO22/3regjWHGjlrzCNHzma2SgDhTxGaLDJl1LnsUevbVb6TGloiQPXwum8oa7dvZ1PqspqyqZEb31t/FyUnG+VXnC0YYpdRj3eRGqeoqqaNtad97DrPHP7er9LdvJIKjsXux7gUW4hKWsr+jsU/krdHpTUC8GYWdTF54EcLhxfzNYKL7voTq+xoQ2yxCOSiBmcQCviuQyVvNQyhde/+edAmOt24CLiuSQjHCbEWzBQs9QinUPRekg6+LJ1WaifTIKkhsm04AdaZrs7LR34hF+Mpqp4HHl/AfcbtVeB/W7jUnhJyMFaQDfGkpzSZs=
|
||||||
|
- secure: izhN5Z3WdajR3ois2T55qepsvLwVg/wv8u4kVQ4TqWhUL08tka83m/W+EMzS/tcvfz7J3VkuTFrJ5scYD9kaTVhRo4dv2u+DdbPmTNcf/hmADXLVLxddyueK3bWEcBurg8+rSdqq/RdI+5CPwWeGtQl+lmjRCyBzodIpQ90zJQF4Al7nmmLuEUhiNVjuqQ3VB1pFLYgky4SVM0bfJnoKSDsZ2z9DOOJE34ZUUmcNqVcQoZ5/oM+PWdVDkUqW3vMK1lTMtE/dk6WcSztQwFyoMrW+uzEstPwUsJCyuBEx4KdioXZH3vrlxRApySfHmEf5eVWwE6jyPSHuWj/2D5O4R9LY1dq1Wcoiu3BJj19B4V3s4L2uJF+xL077d4Mna6z9dE4RSRzs8Z8MvSMTgzDkga/A25JI3XxJMJ78WTbkNQ4hVFN2xwcU5cm+fbs3Sr1ZEdFW/MWAPtUQOzscqS5Op7sSLLaiqO+R0zj56H2NA2bl/zCmbZhyLcOPl0oAfJ85bqNxyF8CoO+GZ98UG15ROigC90/HCP7TUHZnQSrGtiFGTiPTBm+VCITYmC5IEyJBTwgqh/ljbDzz4UuSZ3KsldL3MwWnqO3tGr6VvPfqKF6xq0vuyn9P7f9WNAYwZGcRi3AtxtY+znO+IGv2sGmrfo7ZY+U4nceXTEDrG8OY0Jo=
|
||||||
|
node_js: 4
|
||||||
|
addons:
|
||||||
firefox: latest
|
firefox: latest
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- google-chrome
|
- google-chrome
|
||||||
packages:
|
packages:
|
||||||
- google-chrome-stable
|
- google-chrome-stable
|
||||||
- node_js: node
|
script:
|
||||||
script:
|
- xvfb-run wct
|
||||||
- |
|
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
|
||||||
wct -s 'default'
|
|
||||||
fi
|
|
||||||
before_script:
|
|
||||||
- npm install web-component-tester
|
|
||||||
- npm install bower
|
|
||||||
- export PATH=$PWD/node_modules/.bin:$PATH
|
|
||||||
- bower install
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- secure: EJSBYkW/C3ppDTbxHYRzyFPAko5R1ET1LSbdM484/j0OHGLkSIwtKrrZLNz5+QEmKSw79MpLpBoD+SfXuSCn0yKkf6tvK4mt+kRs32vKVfoWrYReVcfth+EWV7QDpTDJw1QEijT1bKUxULhP0OrT2/5vVpKpXX2zczg+VFL7IZuY3y1dsA4qWmWTfMiAk3762dZx47D5qzJ4POHlpG0i/cHH2EgqV8sFXFBctf6EY68GqzStPUuMuea6xX2wMrebg6vqQDfDb1gs8N34gxGE+u8QaqOSniW1Vzdoe1vwOUo4dbJYw3JMYK5Qn2pj3p2E4m9J609JNnBfqjS7mB5KVC7Hf5r9ul3UMsAIlOnlmSqOq1oO22/3regjWHGjlrzCNHzma2SgDhTxGaLDJl1LnsUevbVb6TGloiQPXwum8oa7dvZ1PqspqyqZEb31t/FyUnG+VXnC0YYpdRj3eRGqeoqqaNtad97DrPHP7er9LdvJIKjsXux7gUW4hKWsr+jsU/krdHpTUC8GYWdTF54EcLhxfzNYKL7voTq+xoQ2yxCOSiBmcQCviuQyVvNQyhde/+edAmOt24CLiuSQjHCbEWzBQs9QinUPRekg6+LJ1WaifTIKkhsm04AdaZrs7LR34hF+Mpqp4HHl/AfcbtVeB/W7jUnhJyMFaQDfGkpzSZs=
|
|
||||||
- secure: izhN5Z3WdajR3ois2T55qepsvLwVg/wv8u4kVQ4TqWhUL08tka83m/W+EMzS/tcvfz7J3VkuTFrJ5scYD9kaTVhRo4dv2u+DdbPmTNcf/hmADXLVLxddyueK3bWEcBurg8+rSdqq/RdI+5CPwWeGtQl+lmjRCyBzodIpQ90zJQF4Al7nmmLuEUhiNVjuqQ3VB1pFLYgky4SVM0bfJnoKSDsZ2z9DOOJE34ZUUmcNqVcQoZ5/oM+PWdVDkUqW3vMK1lTMtE/dk6WcSztQwFyoMrW+uzEstPwUsJCyuBEx4KdioXZH3vrlxRApySfHmEf5eVWwE6jyPSHuWj/2D5O4R9LY1dq1Wcoiu3BJj19B4V3s4L2uJF+xL077d4Mna6z9dE4RSRzs8Z8MvSMTgzDkga/A25JI3XxJMJ78WTbkNQ4hVFN2xwcU5cm+fbs3Sr1ZEdFW/MWAPtUQOzscqS5Op7sSLLaiqO+R0zj56H2NA2bl/zCmbZhyLcOPl0oAfJ85bqNxyF8CoO+GZ98UG15ROigC90/HCP7TUHZnQSrGtiFGTiPTBm+VCITYmC5IEyJBTwgqh/ljbDzz4UuSZ3KsldL3MwWnqO3tGr6VvPfqKF6xq0vuyn9P7f9WNAYwZGcRi3AtxtY+znO+IGv2sGmrfo7ZY+U4nceXTEDrG8OY0Jo=
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-checked-element-behavior",
|
"name": "iron-checked-element-behavior",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"description": "Implements an element that has a checked attribute and can be added to a form",
|
"description": "Implements an element that has a checked attribute and can be added to a form",
|
||||||
"authors": "The Polymer Authors",
|
"authors": "The Polymer Authors",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
@ -74,6 +74,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns false if the element is required and not checked, and true otherwise.
|
* Returns false if the element is required and not checked, and true otherwise.
|
||||||
|
* @param {*=} _value Ignored.
|
||||||
* @return {boolean} true if `required` is false, or if `required` and `checked` are both true.
|
* @return {boolean} true if `required` is false, or if `required` and `checked` are both true.
|
||||||
*/
|
*/
|
||||||
_getValidity: function(_value) {
|
_getValidity: function(_value) {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<!doctype html>
|
<!DOCTYPE html><!--
|
||||||
<!--
|
|
||||||
@license
|
@license
|
||||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||||
|
@ -7,9 +6,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||||
Code distributed by Google as part of the polymer project is also
|
Code distributed by Google as part of the polymer project is also
|
||||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
-->
|
--><html><head>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
|
|
||||||
<title>iron-checked-element-behavior tests</title>
|
<title>iron-checked-element-behavior tests</title>
|
||||||
|
|
||||||
|
@ -23,12 +20,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
WCT.loadSuites([
|
WCT.loadSuites([
|
||||||
'basic.html'
|
'basic.html',
|
||||||
|
'basic.html?dom=shadow'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
</body></html>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-icons",
|
"name": "iron-icons",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"description": "A set of icons for use with iron-icon",
|
"description": "A set of icons for use with iron-icon",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
@ -34,11 +34,11 @@
|
||||||
"util",
|
"util",
|
||||||
"update-icons.sh"
|
"update-icons.sh"
|
||||||
],
|
],
|
||||||
"_release": "1.0.5",
|
"_release": "1.0.6",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.5",
|
"tag": "v1.0.6",
|
||||||
"commit": "39da54afbc17af343d1f95e62c5c0c477492677a"
|
"commit": "bea6cd482cb127b08f9fbcb2b74aa7bbc8604076"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-icons.git",
|
"_source": "git://github.com/PolymerElements/iron-icons.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
|
|
|
@ -11,7 +11,7 @@ env:
|
||||||
- secure: LBT0VumsEPWUYm0OLhqHU1XWmVY18QP64cMeqZAwASnYYyH/R5OGYAcI7aH8To29FWpkZSL85NPto37bN+f8DWRSULq4p+1wl2HviYHsam8x1NzN7hKq6nv+203qaT9SflheaNy6sSDfZJQ+36bRcGQ5khKkVeDpw7h8D/osSQ4=
|
- secure: LBT0VumsEPWUYm0OLhqHU1XWmVY18QP64cMeqZAwASnYYyH/R5OGYAcI7aH8To29FWpkZSL85NPto37bN+f8DWRSULq4p+1wl2HviYHsam8x1NzN7hKq6nv+203qaT9SflheaNy6sSDfZJQ+36bRcGQ5khKkVeDpw7h8D/osSQ4=
|
||||||
node_js: 4
|
node_js: 4
|
||||||
addons:
|
addons:
|
||||||
firefox: '42.0'
|
firefox: latest
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- google-chrome
|
- google-chrome
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-icons",
|
"name": "iron-icons",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"description": "A set of icons for use with iron-icon",
|
"description": "A set of icons for use with iron-icon",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
|
|
@ -63,7 +63,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
}
|
}
|
||||||
|
|
||||||
.set:nth-of-type(4n-2) {
|
.set:nth-of-type(4n-2) {
|
||||||
color: var(--google-yellow-300);
|
color: var(--paper-pink-500);
|
||||||
}
|
}
|
||||||
|
|
||||||
.set:nth-of-type(4n-1) {
|
.set:nth-of-type(4n-1) {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||||
Code distributed by Google as part of the polymer project is also
|
Code distributed by Google as part of the polymer project is also
|
||||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
-->
|
-->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-item",
|
"name": "paper-item",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "A material-design styled list item",
|
"description": "A material-design styled list item",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/PolymerElements/paper-item"
|
"url": "git://github.com/PolymerElements/paper-item"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "http://polymer.github.io/LICENSE.txt",
|
||||||
"homepage": "https://github.com/PolymerElements/paper-item",
|
"homepage": "https://github.com/PolymerElements/paper-item",
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -42,11 +42,11 @@
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
|
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
|
||||||
},
|
},
|
||||||
"_release": "1.1.2",
|
"_release": "1.1.3",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.1.2",
|
"tag": "v1.1.3",
|
||||||
"commit": "e6d048b25af0a84e1ff9f48450f07972326d476b"
|
"commit": "280c2e703315a6f1f707bec6fd0b1e0b80fee8f4"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/paper-item.git",
|
"_source": "git://github.com/PolymerElements/paper-item.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-item",
|
"name": "paper-item",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "A material-design styled list item",
|
"description": "A material-design styled list item",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/PolymerElements/paper-item"
|
"url": "git://github.com/PolymerElements/paper-item"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "http://polymer.github.io/LICENSE.txt",
|
||||||
"homepage": "https://github.com/PolymerElements/paper-item",
|
"homepage": "https://github.com/PolymerElements/paper-item",
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -30,12 +30,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
<link rel="import" href="../paper-item-body.html">
|
<link rel="import" href="../paper-item-body.html">
|
||||||
<link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
|
<link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
|
||||||
<link rel="import" href="../../paper-styles/demo-pages.html">
|
<link rel="import" href="../../paper-styles/demo-pages.html">
|
||||||
|
|
||||||
<style is="custom-style">
|
<style is="custom-style">
|
||||||
.list {
|
.list {
|
||||||
|
@apply(--layout-vertical);
|
||||||
|
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
display: inline-block;
|
|
||||||
width: 240px;
|
width: 240px;
|
||||||
height: 228px;
|
height: 228px;
|
||||||
margin: 12px;
|
margin: 12px;
|
||||||
|
@ -257,7 +257,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
<div secondary>Personal</div>
|
<div secondary>Personal</div>
|
||||||
</paper-item-body>
|
</paper-item-body>
|
||||||
</paper-icon-item>
|
</paper-icon-item>
|
||||||
<paper-icon-item>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<link rel="import" href="../polymer/polymer.html">
|
<link rel="import" href="../polymer/polymer.html">
|
||||||
<link rel="import" href="../iron-behaviors/iron-control-state.html">
|
|
||||||
<link rel="import" href="../iron-behaviors/iron-button-state.html">
|
|
||||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
||||||
<link rel="import" href="../paper-styles/typography.html">
|
<link rel="import" href="../paper-styles/typography.html">
|
||||||
<link rel="import" href="../paper-styles/color.html">
|
|
||||||
<link rel="import" href="../paper-styles/default-theme.html">
|
|
||||||
<link rel="import" href="paper-item-behavior.html">
|
<link rel="import" href="paper-item-behavior.html">
|
||||||
<link rel="import" href="paper-item-shared-styles.html">
|
<link rel="import" href="paper-item-shared-styles.html">
|
||||||
|
|
||||||
|
@ -63,9 +59,10 @@ Custom property | Description |
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-icon {
|
.content-icon {
|
||||||
width: var(--paper-item-icon-width, 56px);
|
|
||||||
@apply(--layout-horizontal);
|
@apply(--layout-horizontal);
|
||||||
@apply(--layout-center);
|
@apply(--layout-center);
|
||||||
|
|
||||||
|
width: var(--paper-item-icon-width, 56px);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<link rel="import" href="../polymer/polymer.html">
|
<link rel="import" href="../polymer/polymer.html">
|
||||||
<link rel="import" href="../iron-behaviors/iron-control-state.html">
|
|
||||||
<link rel="import" href="../iron-behaviors/iron-button-state.html">
|
<link rel="import" href="../iron-behaviors/iron-button-state.html">
|
||||||
|
<link rel="import" href="../iron-behaviors/iron-control-state.html">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
`PaperItemBehavior` is a convenience behavior shared by <paper-item> and
|
`PaperItemBehavior` is a convenience behavior shared by <paper-item> and
|
||||||
|
@ -29,9 +29,8 @@ the items.
|
||||||
|
|
||||||
/** @polymerBehavior */
|
/** @polymerBehavior */
|
||||||
Polymer.PaperItemBehavior = [
|
Polymer.PaperItemBehavior = [
|
||||||
Polymer.IronControlState,
|
|
||||||
Polymer.IronButtonState,
|
Polymer.IronButtonState,
|
||||||
|
Polymer.IronControlState,
|
||||||
Polymer.PaperItemBehaviorImpl
|
Polymer.PaperItemBehaviorImpl
|
||||||
];
|
];
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -11,8 +11,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
<link rel="import" href="../polymer/polymer.html">
|
<link rel="import" href="../polymer/polymer.html">
|
||||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
||||||
<link rel="import" href="../paper-styles/default-theme.html">
|
<link rel="import" href="../paper-styles/default-theme.html">
|
||||||
<link rel="import" href="../paper-styles/color.html">
|
|
||||||
<link rel="import" href="../paper-styles/typography.html">
|
<link rel="import" href="../paper-styles/typography.html">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Use `<paper-item-body>` in a `<paper-item>` or `<paper-icon-item>` to make two- or
|
Use `<paper-item-body>` in a `<paper-item>` or `<paper-icon-item>` to make two- or
|
||||||
three- line items. It is a flex item that is a vertical flexbox.
|
three- line items. It is a flex item that is a vertical flexbox.
|
||||||
|
@ -58,15 +58,16 @@ Custom property | Description | Default
|
||||||
}
|
}
|
||||||
|
|
||||||
:host > ::content > * {
|
:host > ::content > * {
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host > ::content [secondary] {
|
:host > ::content [secondary] {
|
||||||
color: var(--paper-item-body-secondary-color, --secondary-text-color);
|
|
||||||
@apply(--paper-font-body1);
|
@apply(--paper-font-body1);
|
||||||
|
|
||||||
|
color: var(--paper-item-body-secondary-color, --secondary-text-color);
|
||||||
|
|
||||||
@apply(--paper-item-body-secondary);
|
@apply(--paper-item-body-secondary);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -8,35 +8,48 @@ Code distributed by Google as part of the polymer project is also
|
||||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
||||||
|
<link rel="import" href="../paper-styles/default-theme.html">
|
||||||
|
<link rel="import" href="../paper-styles/color.html">
|
||||||
|
|
||||||
<dom-module id="paper-item-shared-styles">
|
<dom-module id="paper-item-shared-styles">
|
||||||
<template>
|
<template>
|
||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
|
position: relative;
|
||||||
min-height: var(--paper-item-min-height, 48px);
|
min-height: var(--paper-item-min-height, 48px);
|
||||||
padding: 0px 16px;
|
padding: 0px 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host([hidden]) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
:host(.iron-selected) {
|
:host(.iron-selected) {
|
||||||
font-weight: var(--paper-item-selected-weight, bold);
|
font-weight: var(--paper-item-selected-weight, bold);
|
||||||
|
|
||||||
@apply(--paper-item-selected);
|
@apply(--paper-item-selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([disabled]) {
|
:host([disabled]) {
|
||||||
color: var(--paper-item-disabled-color, --disabled-text-color);
|
color: var(--paper-item-disabled-color, --disabled-text-color);
|
||||||
|
|
||||||
@apply(--paper-item-disabled);
|
@apply(--paper-item-disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(:focus) {
|
:host(:focus) {
|
||||||
position: relative;
|
position: relative;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
|
|
||||||
@apply(--paper-item-focused);
|
@apply(--paper-item-focused);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(:focus):before {
|
:host(:focus):before {
|
||||||
@apply(--layout-fit);
|
@apply(--layout-fit);
|
||||||
content: '';
|
|
||||||
background: currentColor;
|
background: currentColor;
|
||||||
|
content: '';
|
||||||
opacity: var(--dark-divider-opacity);
|
opacity: var(--dark-divider-opacity);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<link rel="import" href="../polymer/polymer.html">
|
<link rel="import" href="../polymer/polymer.html">
|
||||||
<link rel="import" href="../iron-behaviors/iron-control-state.html">
|
|
||||||
<link rel="import" href="../iron-behaviors/iron-button-state.html">
|
|
||||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
||||||
<link rel="import" href="../paper-styles/default-theme.html">
|
|
||||||
<link rel="import" href="../paper-styles/color.html">
|
|
||||||
<link rel="import" href="paper-item-behavior.html">
|
<link rel="import" href="paper-item-behavior.html">
|
||||||
<link rel="import" href="paper-item-shared-styles.html">
|
<link rel="import" href="paper-item-shared-styles.html">
|
||||||
|
|
||||||
|
@ -40,7 +36,7 @@ items.
|
||||||
The following custom properties and mixins are available for styling:
|
The following custom properties and mixins are available for styling:
|
||||||
|
|
||||||
Custom property | Description | Default
|
Custom property | Description | Default
|
||||||
------------------------------|------------------------------------------------|----------
|
------------------------------|----------------------------------------------|----------
|
||||||
`--paper-item-min-height` | Minimum height of the item | `48px`
|
`--paper-item-min-height` | Minimum height of the item | `48px`
|
||||||
`--paper-item` | Mixin applied to the item | `{}`
|
`--paper-item` | Mixin applied to the item | `{}`
|
||||||
`--paper-item-selected-weight`| The font weight of a selected item | `bold`
|
`--paper-item-selected-weight`| The font weight of a selected item | `bold`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-styles",
|
"name": "paper-styles",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "Common (global) styles for Material Design elements.",
|
"description": "Common (global) styles for Material Design elements.",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
@ -29,11 +29,11 @@
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0"
|
"iron-component-page": "polymerelements/iron-component-page#^1.0.0"
|
||||||
},
|
},
|
||||||
"_release": "1.1.0",
|
"_release": "1.1.1",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.1.0",
|
"tag": "v1.1.1",
|
||||||
"commit": "4104485003ccbcf2c3c9eb542156930974294525"
|
"commit": "fc3ca8dcfc69b9c7a7261e51eefc9741d0f113f8"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/paper-styles.git",
|
"_source": "git://github.com/PolymerElements/paper-styles.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-styles",
|
"name": "paper-styles",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "Common (global) styles for Material Design elements.",
|
"description": "Common (global) styles for Material Design elements.",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
|
|
@ -38,8 +38,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
/*
|
/*
|
||||||
* Primary and accent colors. Also see color.html for more colors.
|
* Primary and accent colors. Also see color.html for more colors.
|
||||||
*/
|
*/
|
||||||
|
--primary-color: #3f51b5; /* --paper-indigo-500 */
|
||||||
--light-primary-color: #c5cae9; /* --paper-indigo-100 */
|
--light-primary-color: #c5cae9; /* --paper-indigo-100 */
|
||||||
--default-primary-color: #3f51b5; /* --paper-indigo-500 */
|
|
||||||
--dark-primary-color: #303f9f; /* --paper-indigo-700 */
|
--dark-primary-color: #303f9f; /* --paper-indigo-700 */
|
||||||
|
|
||||||
--accent-color: #ff4081; /* --paper-pink-a200 */
|
--accent-color: #ff4081; /* --paper-pink-a200 */
|
||||||
|
@ -55,6 +55,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
--secondary-text-color: var(--light-theme-secondary-color);
|
--secondary-text-color: var(--light-theme-secondary-color);
|
||||||
--disabled-text-color:var(--light-theme-disabled-color);
|
--disabled-text-color:var(--light-theme-disabled-color);
|
||||||
--divider-color: var(--light-theme-divider-color);
|
--divider-color: var(--light-theme-divider-color);
|
||||||
|
--default-primary-color: var(--primary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-toggle-button",
|
"name": "paper-toggle-button",
|
||||||
"version": "1.0.12",
|
"version": "1.0.13",
|
||||||
"description": "A material design toggle button control",
|
"description": "A material design toggle button control",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
@ -36,11 +36,11 @@
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"main": "paper-toggle-button.html",
|
"main": "paper-toggle-button.html",
|
||||||
"_release": "1.0.12",
|
"_release": "1.0.13",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.12",
|
"tag": "1.0.13",
|
||||||
"commit": "363fb16086662fea165668ffe10be233e02e0aa9"
|
"commit": "dbc3924b8d9c16ee6376704dd80c39d12aee72c8"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/paper-toggle-button.git",
|
"_source": "git://github.com/PolymerElements/paper-toggle-button.git",
|
||||||
"_target": "~1.0.5",
|
"_target": "~1.0.5",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "paper-toggle-button",
|
"name": "paper-toggle-button",
|
||||||
"version": "1.0.12",
|
"version": "1.0.13",
|
||||||
"description": "A material design toggle button control",
|
"description": "A material design toggle button control",
|
||||||
"authors": [
|
"authors": [
|
||||||
"The Polymer Authors"
|
"The Polymer Authors"
|
||||||
|
|
|
@ -25,7 +25,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
|
|
||||||
<style is="custom-style" include="demo-pages-shared-styles">
|
<style is="custom-style" include="demo-pages-shared-styles">
|
||||||
.vertical-section-container {
|
.vertical-section-container {
|
||||||
max-width: 600px;
|
max-width: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
paper-toggle-button {
|
paper-toggle-button {
|
||||||
|
@ -44,18 +44,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
<paper-toggle-button disabled>Disabled</paper-toggle-button>
|
<paper-toggle-button disabled>Disabled</paper-toggle-button>
|
||||||
</template>
|
</template>
|
||||||
</demo-snippet>
|
</demo-snippet>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="vertical-section-container centered">
|
|
||||||
<h3>Toggle buttons can hide the ripple effect using the <i>noink</i> attribute</h3>
|
<h3>Toggle buttons can hide the ripple effect using the <i>noink</i> attribute</h3>
|
||||||
<demo-snippet class="centered-demo">
|
<demo-snippet class="centered-demo">
|
||||||
<template>
|
<template>
|
||||||
<paper-toggle-button noink>Toggle</paper-toggle-button>
|
<paper-toggle-button noink>Toggle</paper-toggle-button>
|
||||||
</template>
|
</template>
|
||||||
</demo-snippet>
|
</demo-snippet>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="vertical-section-container centered">
|
|
||||||
<h3>Toggle buttons can be styled using custom properties</h3>
|
<h3>Toggle buttons can be styled using custom properties</h3>
|
||||||
<demo-snippet class="centered-demo">
|
<demo-snippet class="centered-demo">
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -41,6 +41,7 @@ Custom property | Description | Default
|
||||||
`--paper-toggle-button-checked-bar` | Mixin applied to the slider when the input is checked | `{}`
|
`--paper-toggle-button-checked-bar` | Mixin applied to the slider when the input is checked | `{}`
|
||||||
`--paper-toggle-button-checked-button` | Mixin applied to the slider button when the input is checked | `{}`
|
`--paper-toggle-button-checked-button` | Mixin applied to the slider button when the input is checked | `{}`
|
||||||
`--paper-toggle-button-label-color` | Label color | `--primary-text-color`
|
`--paper-toggle-button-label-color` | Label color | `--primary-text-color`
|
||||||
|
`--paper-toggle-button-label-spacing` | Spacing between the label and the button | `8px`
|
||||||
|
|
||||||
@group Paper Elements
|
@group Paper Elements
|
||||||
@element paper-toggle-button
|
@element paper-toggle-button
|
||||||
|
@ -148,7 +149,7 @@ Custom property | Description | Default
|
||||||
top: -2px;
|
top: -2px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-left: 10px;
|
padding-left: var(--paper-toggle-button-label-spacing, 8px);
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
color: var(--paper-toggle-button-label-color, --primary-text-color);
|
color: var(--paper-toggle-button-label-color, --primary-text-color);
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
"commit": "9cd0b99417eac61e890d11c5119f2e45e752c999"
|
"commit": "9cd0b99417eac61e890d11c5119f2e45e752c999"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/jrburke/requirejs-bower.git",
|
"_source": "git://github.com/jrburke/requirejs-bower.git",
|
||||||
"_target": "~2.1.19",
|
"_target": "^2.1.22",
|
||||||
"_originalSource": "requirejs"
|
"_originalSource": "requirejs"
|
||||||
}
|
}
|
|
@ -91,7 +91,7 @@
|
||||||
|
|
||||||
function downloadToFile(url, dir, filename, callback, errorCallback) {
|
function downloadToFile(url, dir, filename, callback, errorCallback) {
|
||||||
|
|
||||||
Logger.log('Downloading ' + url);
|
console.log('Downloading ' + url);
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', url, true);
|
xhr.open('GET', url, true);
|
||||||
|
@ -146,7 +146,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
var errorCallback = function (e) {
|
var errorCallback = function (e) {
|
||||||
Logger.log('Imagestore error: ' + e.name);
|
console.log('Imagestore error: ' + e.name);
|
||||||
reject();
|
reject();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
};
|
};
|
||||||
reader.onabort = function () {
|
reader.onabort = function () {
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
Logger.log('File read cancelled');
|
console.log('File read cancelled');
|
||||||
};
|
};
|
||||||
|
|
||||||
// Closure to capture the file information.
|
// Closure to capture the file information.
|
||||||
|
|
|
@ -69,7 +69,7 @@ define(function () {
|
||||||
|
|
||||||
var stylesheet = stylesheets[i];
|
var stylesheet = stylesheets[i];
|
||||||
|
|
||||||
Logger.log('Unloading stylesheet: ' + stylesheet.href);
|
console.log('Unloading stylesheet: ' + stylesheet.href);
|
||||||
stylesheet.parentNode.removeChild(stylesheet);
|
stylesheet.parentNode.removeChild(stylesheet);
|
||||||
removeFromLoadHistory(stylesheet.href);
|
removeFromLoadHistory(stylesheet.href);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
// Subtract to avoid getting programs that are starting when the grid ends
|
// Subtract to avoid getting programs that are starting when the grid ends
|
||||||
var nextDay = new Date(date.getTime() + msPerDay - 2000);
|
var nextDay = new Date(date.getTime() + msPerDay - 2000);
|
||||||
|
|
||||||
Logger.log(nextDay);
|
console.log(nextDay);
|
||||||
channelsPromise.then(function (channelsResult) {
|
channelsPromise.then(function (channelsResult) {
|
||||||
|
|
||||||
ApiClient.getLiveTvPrograms({
|
ApiClient.getLiveTvPrograms({
|
||||||
|
|
|
@ -162,7 +162,7 @@
|
||||||
if (options.showConfirmation !== false) {
|
if (options.showConfirmation !== false) {
|
||||||
Dashboard.processServerConfigurationUpdateResult();
|
Dashboard.processServerConfigurationUpdateResult();
|
||||||
}
|
}
|
||||||
$(self).trigger('submitted');
|
Events.trigger(self, 'submitted');
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardBox {
|
.cardBox {
|
||||||
margin: 2px;
|
margin: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 800px) {
|
@media all and (max-width: 800px) {
|
||||||
|
|
|
@ -140,7 +140,7 @@
|
||||||
@media all and (min-width: 1200px) {
|
@media all and (min-width: 1200px) {
|
||||||
|
|
||||||
.ehsContent:not(.fullWidth), .ehsContent .pageTabContent {
|
.ehsContent:not(.fullWidth), .ehsContent .pageTabContent {
|
||||||
width: 95%;
|
width: 96%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,8 @@ paper-tab {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardBox {
|
/* Need the div specifier to gain preference over the value in card.css */
|
||||||
|
div.cardBox {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
html += "</div>";
|
html += "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.trigger($('#latestReviews', page).html(html)[0], 'create');
|
$('#latestReviews', page).html(html).trigger('create');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
picker.innerHTML = getPickerHtml();
|
picker.innerHTML = getPickerHtml();
|
||||||
|
|
||||||
Events.on(picker, 'click', 'a', function () {
|
$(picker).on('click', 'a', function () {
|
||||||
|
|
||||||
var elem = this;
|
var elem = this;
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
|
|
||||||
elem.classList.add('selectedCharacter');
|
elem.classList.add('selectedCharacter');
|
||||||
Events.trigger(picker, 'alphaselect', [this.innerHTML]);
|
$(picker).trigger('alphaselect', [this.innerHTML]);
|
||||||
} else {
|
} else {
|
||||||
Events.trigger(picker, 'alphaclear');
|
$(picker).trigger('alphaclear');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
||||||
Logger.log('Found backdrop id list in cache. Key: ' + key)
|
console.log('Found backdrop id list in cache. Key: ' + key)
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
deferred.resolveWith(null, [data]);
|
deferred.resolveWith(null, [data]);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
this.sessionListener.bind(this),
|
this.sessionListener.bind(this),
|
||||||
this.receiverListener.bind(this));
|
this.receiverListener.bind(this));
|
||||||
|
|
||||||
Logger.log('chromecast.initialize');
|
console.log('chromecast.initialize');
|
||||||
|
|
||||||
chrome.cast.initialize(apiConfig, this.onInitSuccess.bind(this), this.errorHandler);
|
chrome.cast.initialize(apiConfig, this.onInitSuccess.bind(this), this.errorHandler);
|
||||||
|
|
||||||
|
@ -93,14 +93,14 @@
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.onInitSuccess = function () {
|
CastPlayer.prototype.onInitSuccess = function () {
|
||||||
this.isInitialized = true;
|
this.isInitialized = true;
|
||||||
Logger.log("chromecast init success");
|
console.log("chromecast init success");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic error callback function
|
* Generic error callback function
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.onError = function () {
|
CastPlayer.prototype.onError = function () {
|
||||||
Logger.log("chromecast error");
|
console.log("chromecast error");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
this.session = e;
|
this.session = e;
|
||||||
if (this.session) {
|
if (this.session) {
|
||||||
|
|
||||||
Logger.log('sessionListener ' + JSON.stringify(e));
|
console.log('sessionListener ' + JSON.stringify(e));
|
||||||
|
|
||||||
if (this.session.media[0]) {
|
if (this.session.media[0]) {
|
||||||
this.onMediaDiscovered('activeSession', this.session.media[0]);
|
this.onMediaDiscovered('activeSession', this.session.media[0]);
|
||||||
|
@ -165,11 +165,11 @@
|
||||||
CastPlayer.prototype.receiverListener = function (e) {
|
CastPlayer.prototype.receiverListener = function (e) {
|
||||||
|
|
||||||
if (e === 'available') {
|
if (e === 'available') {
|
||||||
Logger.log("chromecast receiver found");
|
console.log("chromecast receiver found");
|
||||||
this.hasReceivers = true;
|
this.hasReceivers = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.log("chromecast receiver list empty");
|
console.log("chromecast receiver list empty");
|
||||||
this.hasReceivers = false;
|
this.hasReceivers = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -179,7 +179,7 @@
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.sessionUpdateListener = function (isAlive) {
|
CastPlayer.prototype.sessionUpdateListener = function (isAlive) {
|
||||||
|
|
||||||
Logger.log('sessionUpdateListener alive: ' + isAlive);
|
console.log('sessionUpdateListener alive: ' + isAlive);
|
||||||
|
|
||||||
if (isAlive) {
|
if (isAlive) {
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
this.deviceState = DEVICE_STATE.IDLE;
|
this.deviceState = DEVICE_STATE.IDLE;
|
||||||
this.castPlayerState = PLAYER_STATE.IDLE;
|
this.castPlayerState = PLAYER_STATE.IDLE;
|
||||||
|
|
||||||
Logger.log('sessionUpdateListener: setting currentMediaSession to null');
|
console.log('sessionUpdateListener: setting currentMediaSession to null');
|
||||||
this.currentMediaSession = null;
|
this.currentMediaSession = null;
|
||||||
|
|
||||||
MediaController.removeActivePlayer(PlayerName);
|
MediaController.removeActivePlayer(PlayerName);
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
* session request in opt_sessionRequest.
|
* session request in opt_sessionRequest.
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.launchApp = function () {
|
CastPlayer.prototype.launchApp = function () {
|
||||||
Logger.log("chromecast launching app...");
|
console.log("chromecast launching app...");
|
||||||
chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this), this.onLaunchError.bind(this));
|
chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this), this.onLaunchError.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.onRequestSessionSuccess = function (e) {
|
CastPlayer.prototype.onRequestSessionSuccess = function (e) {
|
||||||
|
|
||||||
Logger.log("chromecast session success: " + e.sessionId);
|
console.log("chromecast session success: " + e.sessionId);
|
||||||
this.onSessionConnected(e);
|
this.onSessionConnected(e);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.sessionMediaListener = function (e) {
|
CastPlayer.prototype.sessionMediaListener = function (e) {
|
||||||
|
|
||||||
Logger.log('sessionMediaListener');
|
console.log('sessionMediaListener');
|
||||||
this.currentMediaSession = e;
|
this.currentMediaSession = e;
|
||||||
this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler);
|
this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler);
|
||||||
};
|
};
|
||||||
|
@ -247,7 +247,7 @@
|
||||||
* Callback function for launch error
|
* Callback function for launch error
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.onLaunchError = function () {
|
CastPlayer.prototype.onLaunchError = function () {
|
||||||
Logger.log("chromecast launch error");
|
console.log("chromecast launch error");
|
||||||
this.deviceState = DEVICE_STATE.ERROR;
|
this.deviceState = DEVICE_STATE.ERROR;
|
||||||
|
|
||||||
//Dashboard.alert({
|
//Dashboard.alert({
|
||||||
|
@ -276,11 +276,11 @@
|
||||||
* Callback function for stop app success
|
* Callback function for stop app success
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.onStopAppSuccess = function (message) {
|
CastPlayer.prototype.onStopAppSuccess = function (message) {
|
||||||
Logger.log(message);
|
console.log(message);
|
||||||
this.deviceState = DEVICE_STATE.IDLE;
|
this.deviceState = DEVICE_STATE.IDLE;
|
||||||
this.castPlayerState = PLAYER_STATE.IDLE;
|
this.castPlayerState = PLAYER_STATE.IDLE;
|
||||||
|
|
||||||
Logger.log('onStopAppSuccess: setting currentMediaSession to null');
|
console.log('onStopAppSuccess: setting currentMediaSession to null');
|
||||||
this.currentMediaSession = null;
|
this.currentMediaSession = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@
|
||||||
CastPlayer.prototype.loadMedia = function (options, command) {
|
CastPlayer.prototype.loadMedia = function (options, command) {
|
||||||
|
|
||||||
if (!this.session) {
|
if (!this.session) {
|
||||||
Logger.log("no session");
|
console.log("no session");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,13 +370,13 @@
|
||||||
CastPlayer.prototype.sendMessageInternal = function (message) {
|
CastPlayer.prototype.sendMessageInternal = function (message) {
|
||||||
|
|
||||||
message = JSON.stringify(message);
|
message = JSON.stringify(message);
|
||||||
//Logger.log(message);
|
//console.log(message);
|
||||||
|
|
||||||
this.session.sendMessage(messageNamespace, message, this.onPlayCommandSuccess.bind(this), this.errorHandler);
|
this.session.sendMessage(messageNamespace, message, this.onPlayCommandSuccess.bind(this), this.errorHandler);
|
||||||
};
|
};
|
||||||
|
|
||||||
CastPlayer.prototype.onPlayCommandSuccess = function () {
|
CastPlayer.prototype.onPlayCommandSuccess = function () {
|
||||||
Logger.log('Message was sent to receiver ok.');
|
console.log('Message was sent to receiver ok.');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -385,7 +385,7 @@
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.onMediaDiscovered = function (how, mediaSession) {
|
CastPlayer.prototype.onMediaDiscovered = function (how, mediaSession) {
|
||||||
|
|
||||||
Logger.log("chromecast new media session ID:" + mediaSession.mediaSessionId + ' (' + how + ')');
|
console.log("chromecast new media session ID:" + mediaSession.mediaSessionId + ' (' + how + ')');
|
||||||
this.currentMediaSession = mediaSession;
|
this.currentMediaSession = mediaSession;
|
||||||
|
|
||||||
if (how == 'loadMedia') {
|
if (how == 'loadMedia') {
|
||||||
|
@ -408,7 +408,7 @@
|
||||||
if (e == false) {
|
if (e == false) {
|
||||||
this.castPlayerState = PLAYER_STATE.IDLE;
|
this.castPlayerState = PLAYER_STATE.IDLE;
|
||||||
}
|
}
|
||||||
Logger.log("chromecast updating media: " + e);
|
console.log("chromecast updating media: " + e);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -418,7 +418,7 @@
|
||||||
CastPlayer.prototype.setReceiverVolume = function (mute, vol) {
|
CastPlayer.prototype.setReceiverVolume = function (mute, vol) {
|
||||||
|
|
||||||
if (!this.currentMediaSession) {
|
if (!this.currentMediaSession) {
|
||||||
Logger.log('this.currentMediaSession is null');
|
console.log('this.currentMediaSession is null');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@
|
||||||
* Callback function for media command success
|
* Callback function for media command success
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.mediaCommandSuccessCallback = function (info, e) {
|
CastPlayer.prototype.mediaCommandSuccessCallback = function (info, e) {
|
||||||
Logger.log(info);
|
console.log(info);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create Cast Player
|
// Create Cast Player
|
||||||
|
@ -483,18 +483,18 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$(castPlayer).on("connect", function (e) {
|
Events.on(castPlayer, "connect", function (e) {
|
||||||
|
|
||||||
MediaController.setActivePlayer(PlayerName, self.getCurrentTargetInfo());
|
MediaController.setActivePlayer(PlayerName, self.getCurrentTargetInfo());
|
||||||
|
|
||||||
Logger.log('cc: connect');
|
console.log('cc: connect');
|
||||||
// Reset this so the next query doesn't make it appear like content is playing.
|
// Reset this so the next query doesn't make it appear like content is playing.
|
||||||
self.lastPlayerData = {};
|
self.lastPlayerData = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
$(castPlayer).on("playbackstart", function (e, data) {
|
Events.on(castPlayer, "playbackstart", function (e, data) {
|
||||||
|
|
||||||
Logger.log('cc: playbackstart');
|
console.log('cc: playbackstart');
|
||||||
|
|
||||||
castPlayer.initializeCastPlayer();
|
castPlayer.initializeCastPlayer();
|
||||||
|
|
||||||
|
@ -502,9 +502,9 @@
|
||||||
Events.trigger(self, "playbackstart", [state]);
|
Events.trigger(self, "playbackstart", [state]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(castPlayer).on("playbackstop", function (e, data) {
|
Events.on(castPlayer, "playbackstop", function (e, data) {
|
||||||
|
|
||||||
Logger.log('cc: playbackstop');
|
console.log('cc: playbackstop');
|
||||||
var state = self.getPlayerStateInternal(data);
|
var state = self.getPlayerStateInternal(data);
|
||||||
|
|
||||||
Events.trigger(self, "playbackstop", [state]);
|
Events.trigger(self, "playbackstop", [state]);
|
||||||
|
@ -513,9 +513,9 @@
|
||||||
self.lastPlayerData = {};
|
self.lastPlayerData = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
$(castPlayer).on("playbackprogress", function (e, data) {
|
Events.on(castPlayer, "playbackprogress", function (e, data) {
|
||||||
|
|
||||||
Logger.log('cc: positionchange');
|
console.log('cc: positionchange');
|
||||||
var state = self.getPlayerStateInternal(data);
|
var state = self.getPlayerStateInternal(data);
|
||||||
|
|
||||||
Events.trigger(self, "positionchange", [state]);
|
Events.trigger(self, "positionchange", [state]);
|
||||||
|
@ -825,7 +825,7 @@
|
||||||
data = data || self.lastPlayerData;
|
data = data || self.lastPlayerData;
|
||||||
self.lastPlayerData = data;
|
self.lastPlayerData = data;
|
||||||
|
|
||||||
Logger.log(JSON.stringify(data));
|
console.log(JSON.stringify(data));
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -843,7 +843,7 @@
|
||||||
|
|
||||||
MediaController.registerPlayer(new chromecastPlayer());
|
MediaController.registerPlayer(new chromecastPlayer());
|
||||||
|
|
||||||
$(MediaController).on('playerchange', function (e, newPlayer, newTarget) {
|
Events.on(MediaController, 'playerchange', function (e, newPlayer, newTarget) {
|
||||||
if (newPlayer.name == PlayerName) {
|
if (newPlayer.name == PlayerName) {
|
||||||
if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) {
|
if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) {
|
||||||
castPlayer.launchApp();
|
castPlayer.launchApp();
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
DashboardPage.pollForInfo(page);
|
DashboardPage.pollForInfo(page);
|
||||||
DashboardPage.startInterval(apiClient);
|
DashboardPage.startInterval(apiClient);
|
||||||
|
|
||||||
$(apiClient).on("websocketmessage", DashboardPage.onWebSocketMessage)
|
Events.on(apiClient, 'websocketmessage', DashboardPage.onWebSocketMessage);
|
||||||
.on("websocketopen", DashboardPage.onWebSocketOpen);
|
Events.on(apiClient, 'websocketopen', DashboardPage.onWebSocketOpen);
|
||||||
|
|
||||||
DashboardPage.lastAppUpdateCheck = null;
|
DashboardPage.lastAppUpdateCheck = null;
|
||||||
DashboardPage.lastPluginUpdateCheck = null;
|
DashboardPage.lastPluginUpdateCheck = null;
|
||||||
|
@ -53,7 +53,8 @@
|
||||||
var apiClient = ApiClient;
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
if (apiClient) {
|
if (apiClient) {
|
||||||
$(apiClient).off("websocketmessage", DashboardPage.onWebSocketMessage).off("websocketopen", DashboardPage.onWebSocketConnectionChange).off("websocketerror", DashboardPage.onWebSocketConnectionChange).off("websocketclose", DashboardPage.onWebSocketConnectionChange);
|
Events.off(apiClient, 'websocketmessage', DashboardPage.onWebSocketMessage);
|
||||||
|
Events.off(apiClient, 'websocketopen', DashboardPage.onWebSocketOpen);
|
||||||
DashboardPage.stopInterval(apiClient);
|
DashboardPage.stopInterval(apiClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1195,7 +1196,8 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(apiClient).on('websocketmessage', onSocketMessage).on('websocketopen', onSocketOpen);
|
Events.on(apiClient, 'websocketopen', onSocketOpen);
|
||||||
|
Events.on(apiClient, 'websocketmessage', onSocketMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
function startListening(apiClient) {
|
function startListening(apiClient) {
|
||||||
|
@ -1239,7 +1241,8 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
|
||||||
var apiClient = ApiClient;
|
var apiClient = ApiClient;
|
||||||
|
|
||||||
if (apiClient) {
|
if (apiClient) {
|
||||||
$(apiClient).off('websocketopen', onSocketOpen).off('websocketmessage', onSocketOpen);
|
Events.off(apiClient, 'websocketopen', onSocketOpen);
|
||||||
|
Events.off(apiClient, 'websocketmessage', onSocketMessage);
|
||||||
|
|
||||||
stopListening(apiClient);
|
stopListening(apiClient);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1090,7 +1090,7 @@
|
||||||
|
|
||||||
var page = $.mobile.activePage;
|
var page = $.mobile.activePage;
|
||||||
|
|
||||||
Logger.log('Item updated - reloading metadata');
|
console.log('Item updated - reloading metadata');
|
||||||
reload(page);
|
reload(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1098,12 +1098,12 @@
|
||||||
|
|
||||||
function bindItemChanged(page) {
|
function bindItemChanged(page) {
|
||||||
|
|
||||||
$(ApiClient).on("websocketmessage", onWebSocketMessageReceived);
|
Events.on(ApiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
function unbindItemChanged(page) {
|
function unbindItemChanged(page) {
|
||||||
|
|
||||||
$(ApiClient).off("websocketmessage", onWebSocketMessageReceived);
|
Events.off(ApiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onItemDeleted(e, itemId) {
|
function onItemDeleted(e, itemId) {
|
||||||
|
@ -1221,13 +1221,13 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
$(LibraryBrowser).on('itemdeleting', onItemDeleted);
|
Events.on(LibraryBrowser, 'itemdeleting', onItemDeleted);
|
||||||
reload(page);
|
reload(page);
|
||||||
|
|
||||||
}).on('pagebeforehide', "#editItemMetadataPage", function () {
|
}).on('pagebeforehide', "#editItemMetadataPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
$(LibraryBrowser).off('itemdeleting', onItemDeleted);
|
Events.off(LibraryBrowser, 'itemdeleting', onItemDeleted);
|
||||||
|
|
||||||
unbindItemChanged(page);
|
unbindItemChanged(page);
|
||||||
});
|
});
|
||||||
|
|
|
@ -71,7 +71,6 @@
|
||||||
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
||||||
|
|
||||||
updateFilterControls(page, viewPanel);
|
updateFilterControls(page, viewPanel);
|
||||||
var trigger = false;
|
|
||||||
|
|
||||||
if (view == "List") {
|
if (view == "List") {
|
||||||
|
|
||||||
|
@ -79,7 +78,6 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
sortBy: query.SortBy
|
sortBy: query.SortBy
|
||||||
});
|
});
|
||||||
trigger = true;
|
|
||||||
}
|
}
|
||||||
else if (view == "Poster") {
|
else if (view == "Poster") {
|
||||||
html += LibraryBrowser.getPosterViewHtml({
|
html += LibraryBrowser.getPosterViewHtml({
|
||||||
|
@ -108,10 +106,6 @@
|
||||||
elem.innerHTML = html + pagingHtml;
|
elem.innerHTML = html + pagingHtml;
|
||||||
ImageLoader.lazyChildren(elem);
|
ImageLoader.lazyChildren(elem);
|
||||||
|
|
||||||
if (trigger) {
|
|
||||||
Events.trigger(elem, 'create');
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.btnNextPage', page).on('click', function () {
|
$('.btnNextPage', page).on('click', function () {
|
||||||
query.StartIndex += query.Limit;
|
query.StartIndex += query.Limit;
|
||||||
reloadItems(page, viewPanel);
|
reloadItems(page, viewPanel);
|
||||||
|
|
|
@ -383,7 +383,7 @@
|
||||||
|
|
||||||
$('.sliderValue', elem).html(tooltext);
|
$('.sliderValue', elem).html(tooltext);
|
||||||
|
|
||||||
Logger.log("slidin", pct, self.currentDurationTicks, time);
|
console.log("slidin", pct, self.currentDurationTicks, time);
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,14 +30,14 @@
|
||||||
|
|
||||||
var requestUrl = url + "?v=" + AppInfo.appVersion;
|
var requestUrl = url + "?v=" + AppInfo.appVersion;
|
||||||
|
|
||||||
Logger.log('Requesting ' + requestUrl);
|
console.log('Requesting ' + requestUrl);
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', requestUrl, true);
|
xhr.open('GET', requestUrl, true);
|
||||||
|
|
||||||
var onError = function () {
|
var onError = function () {
|
||||||
|
|
||||||
Logger.log('Dictionary not found. Reverting to english');
|
console.log('Dictionary not found. Reverting to english');
|
||||||
|
|
||||||
// Grab the english version
|
// Grab the english version
|
||||||
var xhr2 = new XMLHttpRequest();
|
var xhr2 = new XMLHttpRequest();
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
xhr.onload = function (e) {
|
xhr.onload = function (e) {
|
||||||
|
|
||||||
Logger.log('Globalize response status: ' + this.status);
|
console.log('Globalize response status: ' + this.status);
|
||||||
|
|
||||||
if (this.status < 400) {
|
if (this.status < 400) {
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
var currentCulture = 'en-US';
|
var currentCulture = 'en-US';
|
||||||
function setCulture(value) {
|
function setCulture(value) {
|
||||||
|
|
||||||
Logger.log('Setting culture to ' + value);
|
console.log('Setting culture to ' + value);
|
||||||
currentCulture = value;
|
currentCulture = value;
|
||||||
|
|
||||||
return Promise.all([loadDictionary('html', value), loadDictionary('javascript', value)]);
|
return Promise.all([loadDictionary('html', value), loadDictionary('javascript', value)]);
|
||||||
|
@ -105,13 +105,13 @@
|
||||||
|
|
||||||
} else if (AppInfo.supportsUserDisplayLanguageSetting) {
|
} else if (AppInfo.supportsUserDisplayLanguageSetting) {
|
||||||
|
|
||||||
Logger.log('AppInfo.supportsUserDisplayLanguageSetting is true');
|
console.log('AppInfo.supportsUserDisplayLanguageSetting is true');
|
||||||
|
|
||||||
resolve(AppSettings.displayLanguage());
|
resolve(AppSettings.displayLanguage());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Logger.log('Getting culture from document');
|
console.log('Getting culture from document');
|
||||||
resolve(document.documentElement.getAttribute('data-culture'));
|
resolve(document.documentElement.getAttribute('data-culture'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
|
|
||||||
function ensure() {
|
function ensure() {
|
||||||
|
|
||||||
Logger.log('Entering Globalize.ensure');
|
console.log('Entering Globalize.ensure');
|
||||||
|
|
||||||
return getDeviceCulture().then(function (culture) {
|
return getDeviceCulture().then(function (culture) {
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
var supportsTextTracks;
|
var supportsTextTracks;
|
||||||
var hlsPlayer;
|
var hlsPlayer;
|
||||||
var requiresSettingStartTimeOnStart;
|
var requiresSettingStartTimeOnStart;
|
||||||
|
var subtitleTrackIndexToSetOnPlaying;
|
||||||
|
|
||||||
function htmlMediaRenderer(options) {
|
function htmlMediaRenderer(options) {
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
|
|
||||||
function onEnded() {
|
function onEnded() {
|
||||||
showStatusBar();
|
showStatusBar();
|
||||||
$(self).trigger('ended');
|
Events.trigger(self, 'ended');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTimeUpdate() {
|
function onTimeUpdate() {
|
||||||
|
@ -46,50 +47,58 @@
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
$(self).trigger('timeupdate');
|
Events.trigger(self, 'timeupdate');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onVolumeChange() {
|
function onVolumeChange() {
|
||||||
$(self).trigger('volumechange');
|
Events.trigger(self, 'volumechange');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onOneAudioPlaying() {
|
function onOneAudioPlaying(e) {
|
||||||
|
|
||||||
|
var elem = e.target;
|
||||||
|
elem.removeEventListener('playing', onOneAudioPlaying);
|
||||||
$('.mediaPlayerAudioContainer').hide();
|
$('.mediaPlayerAudioContainer').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPlaying() {
|
function onPlaying() {
|
||||||
$(self).trigger('playing');
|
Events.trigger(self, 'playing');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPlay() {
|
function onPlay() {
|
||||||
$(self).trigger('play');
|
Events.trigger(self, 'play');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPause() {
|
function onPause() {
|
||||||
$(self).trigger('pause');
|
Events.trigger(self, 'pause');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClick() {
|
function onClick() {
|
||||||
$(self).trigger('click');
|
Events.trigger(self, 'click');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDblClick() {
|
function onDblClick() {
|
||||||
$(self).trigger('dblclick');
|
Events.trigger(self, 'dblclick');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onError() {
|
function onError(e) {
|
||||||
|
|
||||||
var errorCode = this.error ? this.error.code : '';
|
var elem = e.target;
|
||||||
Logger.log('Media element error code: ' + errorCode);
|
var errorCode = elem.error ? elem.error.code : '';
|
||||||
|
console.log('Media element error code: ' + errorCode);
|
||||||
|
|
||||||
showStatusBar();
|
showStatusBar();
|
||||||
$(self).trigger('error');
|
Events.trigger(self, 'error');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLoadedMetadata() {
|
function onLoadedMetadata(e) {
|
||||||
|
|
||||||
|
var elem = e.target;
|
||||||
|
|
||||||
|
elem.removeEventListener('loadedmetadata', onLoadedMetadata);
|
||||||
|
|
||||||
if (!hlsPlayer) {
|
if (!hlsPlayer) {
|
||||||
this.play();
|
elem.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,14 +128,19 @@
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onOneVideoPlaying() {
|
function onOneVideoPlaying(e) {
|
||||||
|
|
||||||
hideStatusBar();
|
hideStatusBar();
|
||||||
|
|
||||||
|
var element = e.target;
|
||||||
|
element.removeEventListener('playing', onOneVideoPlaying);
|
||||||
|
|
||||||
|
self.setCurrentTrackElement(subtitleTrackIndexToSetOnPlaying);
|
||||||
|
|
||||||
var requiresNativeControls = !self.enableCustomVideoControls();
|
var requiresNativeControls = !self.enableCustomVideoControls();
|
||||||
|
|
||||||
if (requiresNativeControls) {
|
if (requiresNativeControls) {
|
||||||
$(this).attr('controls', 'controls');
|
$(element).attr('controls', 'controls');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requiresSettingStartTimeOnStart) {
|
if (requiresSettingStartTimeOnStart) {
|
||||||
|
@ -138,7 +152,6 @@
|
||||||
if (startPositionInSeekParam && src.indexOf('.m3u8') != -1) {
|
if (startPositionInSeekParam && src.indexOf('.m3u8') != -1) {
|
||||||
|
|
||||||
var delay = browserInfo.safari ? 2500 : 0;
|
var delay = browserInfo.safari ? 2500 : 0;
|
||||||
var element = this;
|
|
||||||
if (delay) {
|
if (delay) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
element.currentTime = startPositionInSeekParam;
|
element.currentTime = startPositionInSeekParam;
|
||||||
|
@ -173,15 +186,18 @@
|
||||||
elem = $('.mediaPlayerAudio');
|
elem = $('.mediaPlayerAudio');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $(elem)
|
elem = elem[0];
|
||||||
.on('timeupdate', onTimeUpdate)
|
|
||||||
.on('ended', onEnded)
|
elem.addEventListener('playing', onOneAudioPlaying);
|
||||||
.on('volumechange', onVolumeChange)
|
elem.addEventListener('timeupdate', onTimeUpdate);
|
||||||
.one('playing', onOneAudioPlaying)
|
elem.addEventListener('ended', onEnded);
|
||||||
.on('play', onPlay)
|
elem.addEventListener('volumechange', onVolumeChange);
|
||||||
.on('pause', onPause)
|
elem.addEventListener('error', onError);
|
||||||
.on('playing', onPlaying)
|
elem.addEventListener('pause', onPause);
|
||||||
.on('error', onError)[0];
|
elem.addEventListener('play', onPlay);
|
||||||
|
elem.addEventListener('playing', onPlaying);
|
||||||
|
|
||||||
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableHlsPlayer(src) {
|
function enableHlsPlayer(src) {
|
||||||
|
@ -221,18 +237,24 @@
|
||||||
|
|
||||||
var elem = $('#videoElement', '#videoPlayer').prepend(html);
|
var elem = $('#videoElement', '#videoPlayer').prepend(html);
|
||||||
|
|
||||||
return $('.itemVideo', elem)
|
var itemVideo = $('.itemVideo', elem)[0];
|
||||||
.one('.loadedmetadata', onLoadedMetadata)
|
|
||||||
.one('playing', onOneVideoPlaying)
|
itemVideo.addEventListener('loadedmetadata', onLoadedMetadata);
|
||||||
.on('timeupdate', onTimeUpdate)
|
itemVideo.addEventListener('playing', onOneVideoPlaying);
|
||||||
.on('ended', onEnded)
|
|
||||||
.on('volumechange', onVolumeChange)
|
itemVideo.addEventListener('timeupdate', onTimeUpdate);
|
||||||
.on('play', onPlay)
|
itemVideo.addEventListener('ended', onEnded);
|
||||||
.on('pause', onPause)
|
itemVideo.addEventListener('volumechange', onVolumeChange);
|
||||||
.on('playing', onPlaying)
|
|
||||||
.on('click', onClick)
|
itemVideo.addEventListener('voluplaymechange', onPlay);
|
||||||
.on('dblclick', onDblClick)
|
itemVideo.addEventListener('pause', onPause);
|
||||||
.on('error', onError)[0];
|
itemVideo.addEventListener('playing', onPlaying);
|
||||||
|
|
||||||
|
itemVideo.addEventListener('click', onClick);
|
||||||
|
itemVideo.addEventListener('dblclick', onDblClick);
|
||||||
|
itemVideo.addEventListener('error', onError);
|
||||||
|
|
||||||
|
return itemVideo;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save this for when playback stops, because querying the time at that point might return 0
|
// Save this for when playback stops, because querying the time at that point might return 0
|
||||||
|
@ -274,7 +296,7 @@
|
||||||
hlsPlayer.destroy();
|
hlsPlayer.destroy();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
Logger.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
hlsPlayer = null;
|
hlsPlayer = null;
|
||||||
|
@ -365,6 +387,15 @@
|
||||||
|
|
||||||
tracks = tracks || [];
|
tracks = tracks || [];
|
||||||
|
|
||||||
|
var currentTrackIndex = -1;
|
||||||
|
for (var i = 0, length = tracks.length; i < length; i++) {
|
||||||
|
if (tracks[i].isDefault) {
|
||||||
|
currentTrackIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
subtitleTrackIndexToSetOnPlaying = currentTrackIndex;
|
||||||
|
|
||||||
if (enableHlsPlayer(val)) {
|
if (enableHlsPlayer(val)) {
|
||||||
|
|
||||||
setTracks(elem, tracks);
|
setTracks(elem, tracks);
|
||||||
|
@ -384,18 +415,10 @@
|
||||||
|
|
||||||
setTracks(elem, tracks);
|
setTracks(elem, tracks);
|
||||||
|
|
||||||
$(elem).one("loadedmetadata", onLoadedMetadata);
|
elem.addEventListener("loadedmetadata", onLoadedMetadata);
|
||||||
playNow = true;
|
playNow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentTrackIndex = -1;
|
|
||||||
for (var i = 0, length = tracks.length; i < length; i++) {
|
|
||||||
if (tracks[i].isDefault) {
|
|
||||||
currentTrackIndex = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self.setCurrentTrackElement(currentTrackIndex);
|
self.setCurrentTrackElement(currentTrackIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,28 +471,28 @@
|
||||||
|
|
||||||
if (elem.tagName == 'AUDIO') {
|
if (elem.tagName == 'AUDIO') {
|
||||||
|
|
||||||
Events.off(elem, 'timeupdate', onTimeUpdate);
|
elem.removeEventListener('timeupdate', onTimeUpdate);
|
||||||
Events.off(elem, 'ended', onEnded);
|
elem.removeEventListener('ended', onEnded);
|
||||||
Events.off(elem, 'volumechange', onVolumeChange);
|
elem.removeEventListener('volumechange', onVolumeChange);
|
||||||
Events.off(elem, 'playing', onOneAudioPlaying);
|
elem.removeEventListener('playing', onOneAudioPlaying);
|
||||||
Events.off(elem, 'play', onPlay);
|
elem.removeEventListener('play', onPlay);
|
||||||
Events.off(elem, 'pause', onPause);
|
elem.removeEventListener('pause', onPause);
|
||||||
Events.off(elem, 'playing', onPlaying);
|
elem.removeEventListener('playing', onPlaying);
|
||||||
Events.off(elem, 'error', onError);
|
elem.removeEventListener('error', onError);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Events.off(elem, 'loadedmetadata', onLoadedMetadata);
|
elem.removeEventListener('loadedmetadata', onLoadedMetadata);
|
||||||
Events.off(elem, 'playing', onOneVideoPlaying);
|
elem.removeEventListener('playing', onOneVideoPlaying);
|
||||||
Events.off(elem, 'timeupdate', onTimeUpdate);
|
elem.removeEventListener('timeupdate', onTimeUpdate);
|
||||||
Events.off(elem, 'ended', onEnded);
|
elem.removeEventListener('ended', onEnded);
|
||||||
Events.off(elem, 'volumechange', onVolumeChange);
|
elem.removeEventListener('volumechange', onVolumeChange);
|
||||||
Events.off(elem, 'play', onPlay);
|
elem.removeEventListener('play', onPlay);
|
||||||
Events.off(elem, 'pause', onPause);
|
elem.removeEventListener('pause', onPause);
|
||||||
Events.off(elem, 'playing', onPlaying);
|
elem.removeEventListener('playing', onPlaying);
|
||||||
Events.off(elem, 'click', onClick);
|
elem.removeEventListener('click', onClick);
|
||||||
Events.off(elem, 'dblclick', onDblClick);
|
elem.removeEventListener('dblclick', onDblClick);
|
||||||
Events.off(elem, 'error', onError);
|
elem.removeEventListener('error', onError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elem.tagName.toLowerCase() != 'audio') {
|
if (elem.tagName.toLowerCase() != 'audio') {
|
||||||
|
@ -492,7 +515,7 @@
|
||||||
|
|
||||||
self.setCurrentTrackElement = function (trackIndex) {
|
self.setCurrentTrackElement = function (trackIndex) {
|
||||||
|
|
||||||
Logger.log('Setting new text track index to: ' + trackIndex);
|
console.log('Setting new text track index to: ' + trackIndex);
|
||||||
|
|
||||||
var allTracks = mediaElement.textTracks; // get list of tracks
|
var allTracks = mediaElement.textTracks; // get list of tracks
|
||||||
|
|
||||||
|
@ -508,7 +531,7 @@
|
||||||
mode = 0; // hide all other tracks
|
mode = 0; // hide all other tracks
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.log('Setting track ' + i + ' mode to: ' + mode);
|
console.log('Setting track ' + i + ' mode to: ' + mode);
|
||||||
|
|
||||||
// Safari uses integers for the mode property
|
// Safari uses integers for the mode property
|
||||||
// http://www.jwplayer.com/html5/scripting/
|
// http://www.jwplayer.com/html5/scripting/
|
||||||
|
@ -545,7 +568,7 @@
|
||||||
track.removeCue(track.cues[0]);
|
track.removeCue(track.cues[0]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Logger.log('Error removing cue from textTrack');
|
console.log('Error removing cue from textTrack');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -286,13 +286,13 @@
|
||||||
pageIdOn('pageshow', "indexPage", function () {
|
pageIdOn('pageshow', "indexPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
$(MediaController).on('playbackstop', onPlaybackStop);
|
Events.on(MediaController, 'playbackstop', onPlaybackStop);
|
||||||
});
|
});
|
||||||
|
|
||||||
pageIdOn('pagebeforehide', "indexPage", function () {
|
pageIdOn('pagebeforehide', "indexPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
$(MediaController).off('playbackstop', onPlaybackStop);
|
Events.off(MediaController, 'playbackstop', onPlaybackStop);
|
||||||
});
|
});
|
||||||
|
|
||||||
function onPlaybackStop(e, state) {
|
function onPlaybackStop(e, state) {
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NavHelper.isBack()) {
|
if (NavHelper.isBack()) {
|
||||||
Logger.log('Not refreshing data because IsBack=true');
|
console.log('Not refreshing data because IsBack=true');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((now - last) < cacheDuration) {
|
if ((now - last) < cacheDuration) {
|
||||||
Logger.log('Not refreshing data due to age');
|
console.log('Not refreshing data due to age');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@
|
||||||
enableFullPaperTabs: function () {
|
enableFullPaperTabs: function () {
|
||||||
|
|
||||||
if (browserInfo.animate && !browserInfo.mobile) {
|
if (browserInfo.animate && !browserInfo.mobile) {
|
||||||
//return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return AppInfo.isNativeApp;
|
return AppInfo.isNativeApp;
|
||||||
|
@ -385,11 +385,11 @@
|
||||||
|
|
||||||
if (isFirstLoad) {
|
if (isFirstLoad) {
|
||||||
|
|
||||||
Logger.log('selected tab is null, checking query string');
|
console.log('selected tab is null, checking query string');
|
||||||
|
|
||||||
var selected = parseInt(getParameterByName('tab') || '0');
|
var selected = parseInt(getParameterByName('tab') || '0');
|
||||||
|
|
||||||
Logger.log('selected tab will be ' + selected);
|
console.log('selected tab will be ' + selected);
|
||||||
|
|
||||||
if (LibraryBrowser.enableFullPaperTabs()) {
|
if (LibraryBrowser.enableFullPaperTabs()) {
|
||||||
|
|
||||||
|
@ -3364,7 +3364,7 @@
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
Logger.log("Error parsing date: " + item.PremiereDate);
|
console.log("Error parsing date: " + item.PremiereDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3383,7 +3383,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
Logger.log("Error parsing date: " + item.PremiereDate);
|
console.log("Error parsing date: " + item.PremiereDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3409,7 +3409,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
Logger.log("Error parsing date: " + item.EndDate);
|
console.log("Error parsing date: " + item.EndDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3430,7 +3430,7 @@
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
Logger.log("Error parsing date: " + item.PremiereDate);
|
console.log("Error parsing date: " + item.PremiereDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1377,7 +1377,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeApiClient(apiClient) {
|
function initializeApiClient(apiClient) {
|
||||||
$(apiClient).off('websocketmessage', onWebSocketMessage).on('websocketmessage', onWebSocketMessage);
|
Events.off(apiClient, "websocketmessage", onWebSocketMessage);
|
||||||
|
Events.on(apiClient, "websocketmessage", onWebSocketMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearRefreshTimes() {
|
function clearRefreshTimes() {
|
||||||
|
@ -1388,7 +1389,7 @@
|
||||||
initializeApiClient(window.ApiClient);
|
initializeApiClient(window.ApiClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
Events.on(ConnectionManager, 'apiclientcreated', function (e, apiClient) {
|
||||||
initializeApiClient(apiClient);
|
initializeApiClient(apiClient);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@
|
||||||
refreshLibraryInfoInDrawer(user, drawer);
|
refreshLibraryInfoInDrawer(user, drawer);
|
||||||
refreshBottomUserInfoInDrawer(user, drawer);
|
refreshBottomUserInfoInDrawer(user, drawer);
|
||||||
|
|
||||||
Events.trigger(document, 'libraryMenuCreated');
|
document.dispatchEvent(new CustomEvent("libraryMenuCreated", {}));
|
||||||
updateLibraryMenu(user.localUser);
|
updateLibraryMenu(user.localUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@
|
||||||
airDate = parseISO8601Date(airDate, { toLocal: true }).toLocaleDateString();
|
airDate = parseISO8601Date(airDate, { toLocal: true }).toLocaleDateString();
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
Logger.log("Error parsing date: " + airDate);
|
console.log("Error parsing date: " + airDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
html += '</ul>';
|
html += '</ul>';
|
||||||
|
|
||||||
Events.trigger($('.serverLogs', page).html(html)[0], 'create');
|
$('.serverLogs', page).html(html).trigger('create');
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -192,7 +192,7 @@
|
||||||
|
|
||||||
if (bypass()) return;
|
if (bypass()) return;
|
||||||
|
|
||||||
Logger.log("keyCode", e.keyCode);
|
console.log("keyCode", e.keyCode);
|
||||||
|
|
||||||
if (keyResult[e.keyCode]) {
|
if (keyResult[e.keyCode]) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -307,7 +307,7 @@
|
||||||
currentPlayer = player;
|
currentPlayer = player;
|
||||||
currentTargetInfo = targetInfo;
|
currentTargetInfo = targetInfo;
|
||||||
|
|
||||||
Logger.log('Active player: ' + JSON.stringify(currentTargetInfo));
|
console.log('Active player: ' + JSON.stringify(currentTargetInfo));
|
||||||
|
|
||||||
triggerPlayerChange(player, targetInfo);
|
triggerPlayerChange(player, targetInfo);
|
||||||
};
|
};
|
||||||
|
@ -336,7 +336,7 @@
|
||||||
currentPlayer = player;
|
currentPlayer = player;
|
||||||
currentTargetInfo = targetInfo;
|
currentTargetInfo = targetInfo;
|
||||||
|
|
||||||
Logger.log('Active player: ' + JSON.stringify(currentTargetInfo));
|
console.log('Active player: ' + JSON.stringify(currentTargetInfo));
|
||||||
|
|
||||||
triggerPlayerChange(player, targetInfo);
|
triggerPlayerChange(player, targetInfo);
|
||||||
});
|
});
|
||||||
|
@ -720,7 +720,7 @@
|
||||||
|
|
||||||
// Full list
|
// Full list
|
||||||
// https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Model/Session/GeneralCommand.cs#L23
|
// https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Model/Session/GeneralCommand.cs#L23
|
||||||
Logger.log('MediaController received command: ' + cmd.Name);
|
console.log('MediaController received command: ' + cmd.Name);
|
||||||
switch (cmd.Name) {
|
switch (cmd.Name) {
|
||||||
|
|
||||||
case 'SetRepeatMode':
|
case 'SetRepeatMode':
|
||||||
|
@ -950,7 +950,7 @@
|
||||||
require(['localassetmanager'], function () {
|
require(['localassetmanager'], function () {
|
||||||
|
|
||||||
LocalAssetManager.fileExists(mediaSource.Path).then(function (exists) {
|
LocalAssetManager.fileExists(mediaSource.Path).then(function (exists) {
|
||||||
Logger.log('LocalAssetManager.fileExists: path: ' + mediaSource.Path + ' result: ' + exists);
|
console.log('LocalAssetManager.fileExists: path: ' + mediaSource.Path + ' result: ' + exists);
|
||||||
deferred.resolveWith(null, [exists]);
|
deferred.resolveWith(null, [exists]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1026,7 +1026,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeApiClient(apiClient) {
|
function initializeApiClient(apiClient) {
|
||||||
$(apiClient).off("websocketmessage", onWebSocketMessageReceived).on("websocketmessage", onWebSocketMessageReceived);
|
Events.off(apiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||||
|
Events.on(apiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaController.init = function () {
|
MediaController.init = function () {
|
||||||
|
@ -1034,7 +1035,7 @@
|
||||||
initializeApiClient(window.ApiClient);
|
initializeApiClient(window.ApiClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
Events.on(ConnectionManager, 'apiclientcreated', function (e, apiClient) {
|
||||||
initializeApiClient(apiClient);
|
initializeApiClient(apiClient);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -77,11 +77,14 @@
|
||||||
return currentStream.Type == "Subtitle";
|
return currentStream.Type == "Subtitle";
|
||||||
});
|
});
|
||||||
|
|
||||||
var currentIndex = self.currentSubtitleStreamIndex || -1;
|
var currentIndex = self.currentSubtitleStreamIndex;
|
||||||
|
if (currentIndex == null) {
|
||||||
|
currentIndex = -1;
|
||||||
|
}
|
||||||
|
|
||||||
streams.unshift({
|
streams.unshift({
|
||||||
Index: -1,
|
Index: -1,
|
||||||
Language: "Off"
|
Language: Globalize.translate('ButtonOff')
|
||||||
});
|
});
|
||||||
|
|
||||||
var menuItems = streams.map(function (stream) {
|
var menuItems = streams.map(function (stream) {
|
||||||
|
@ -880,6 +883,15 @@
|
||||||
|
|
||||||
function bindEventsForPlayback(mediaRenderer) {
|
function bindEventsForPlayback(mediaRenderer) {
|
||||||
|
|
||||||
|
Events.on(mediaRenderer, 'playing', onOnePlaying);
|
||||||
|
Events.on(mediaRenderer, 'playing', onPlaying);
|
||||||
|
Events.on(mediaRenderer, 'volumechange', onVolumeChange);
|
||||||
|
Events.on(mediaRenderer, 'pause', onPause);
|
||||||
|
Events.on(mediaRenderer, 'timeupdate', onTimeUpdate);
|
||||||
|
Events.on(mediaRenderer, 'error', onError);
|
||||||
|
Events.on(mediaRenderer, 'click', onClick);
|
||||||
|
Events.on(mediaRenderer, 'dblclick', onDoubleClick);
|
||||||
|
|
||||||
var hideElementsOnIdle = true;
|
var hideElementsOnIdle = true;
|
||||||
|
|
||||||
if (hideElementsOnIdle) {
|
if (hideElementsOnIdle) {
|
||||||
|
@ -908,6 +920,16 @@
|
||||||
|
|
||||||
function unbindEventsForPlayback(mediaRenderer) {
|
function unbindEventsForPlayback(mediaRenderer) {
|
||||||
|
|
||||||
|
Events.off(mediaRenderer, 'playing', onOnePlaying);
|
||||||
|
Events.off(mediaRenderer, 'playing', onPlaying);
|
||||||
|
Events.off(mediaRenderer, 'volumechange', onVolumeChange);
|
||||||
|
|
||||||
|
Events.off(mediaRenderer, 'pause', onPause);
|
||||||
|
Events.off(mediaRenderer, 'timeupdate', onTimeUpdate);
|
||||||
|
Events.off(mediaRenderer, 'error', onError);
|
||||||
|
Events.off(mediaRenderer, 'click', onClick);
|
||||||
|
Events.off(mediaRenderer, 'dblclick', onDoubleClick);
|
||||||
|
|
||||||
$(document).off('webkitfullscreenchange', onFullScreenChange);
|
$(document).off('webkitfullscreenchange', onFullScreenChange);
|
||||||
$(document).off('mozfullscreenchange', onFullScreenChange);
|
$(document).off('mozfullscreenchange', onFullScreenChange);
|
||||||
$(document).off('msfullscreenchange', onFullScreenChange);
|
$(document).off('msfullscreenchange', onFullScreenChange);
|
||||||
|
@ -1091,77 +1113,6 @@
|
||||||
volumeSlider.value = initialVolume * 100;
|
volumeSlider.value = initialVolume * 100;
|
||||||
updateVolumeButtons(initialVolume);
|
updateVolumeButtons(initialVolume);
|
||||||
|
|
||||||
$(mediaRenderer).on("volumechange.mediaplayerevent", function (e) {
|
|
||||||
|
|
||||||
updateVolumeButtons(this.volume());
|
|
||||||
|
|
||||||
}).one("playing.mediaplayerevent", function () {
|
|
||||||
|
|
||||||
// For some reason this is firing at the start, so don't bind until playback has begun
|
|
||||||
$(this).on("ended", self.onPlaybackStopped).one('ended', self.playNextAfterEnded);
|
|
||||||
|
|
||||||
self.onPlaybackStart(this, item, mediaSource);
|
|
||||||
|
|
||||||
}).on("pause.mediaplayerevent", function (e) {
|
|
||||||
|
|
||||||
$('#video-playButton', videoControls).show();
|
|
||||||
$('#video-pauseButton', videoControls).hide();
|
|
||||||
$("#pause", videoElement).show().addClass("fadeOut");
|
|
||||||
setTimeout(function () {
|
|
||||||
$("#pause", videoElement).hide().removeClass("fadeOut");
|
|
||||||
}, 300);
|
|
||||||
|
|
||||||
}).on("playing.mediaplayerevent", function (e) {
|
|
||||||
|
|
||||||
$('#video-playButton', videoControls).hide();
|
|
||||||
$('#video-pauseButton', videoControls).show();
|
|
||||||
$("#play", videoElement).show().addClass("fadeOut");
|
|
||||||
setTimeout(function () {
|
|
||||||
$("#play", videoElement).hide().removeClass("fadeOut");
|
|
||||||
}, 300);
|
|
||||||
|
|
||||||
}).on("timeupdate.mediaplayerevent", function () {
|
|
||||||
|
|
||||||
if (!positionSlider.dragging) {
|
|
||||||
|
|
||||||
self.setCurrentTime(self.getCurrentTicks(this), positionSlider, currentTimeElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
}).on("error.mediaplayerevent", function () {
|
|
||||||
|
|
||||||
var errorMsg = Globalize.translate('MessageErrorPlayingVideo');
|
|
||||||
|
|
||||||
if (item.Type == "TvChannel") {
|
|
||||||
errorMsg += '<p>';
|
|
||||||
errorMsg += Globalize.translate('MessageEnsureOpenTuner');
|
|
||||||
errorMsg += '</p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
Dashboard.alert({
|
|
||||||
title: Globalize.translate('HeaderVideoError'),
|
|
||||||
message: errorMsg
|
|
||||||
});
|
|
||||||
|
|
||||||
self.onPlaybackStopped.call(mediaRenderer);
|
|
||||||
self.nextTrack();
|
|
||||||
|
|
||||||
}).on("click.mediaplayerevent", function (e) {
|
|
||||||
|
|
||||||
if (!browserInfo.mobile) {
|
|
||||||
if (this.paused()) {
|
|
||||||
self.unpause();
|
|
||||||
} else {
|
|
||||||
self.pause();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}).on("dblclick.mediaplayerevent", function () {
|
|
||||||
|
|
||||||
if (!browserInfo.mobile) {
|
|
||||||
self.toggleFullscreen();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bindEventsForPlayback(mediaRenderer);
|
bindEventsForPlayback(mediaRenderer);
|
||||||
|
|
||||||
self.currentSubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex;
|
self.currentSubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex;
|
||||||
|
@ -1186,6 +1137,90 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function onOnePlaying() {
|
||||||
|
|
||||||
|
Events.off(this, 'playing', onOnePlaying);
|
||||||
|
|
||||||
|
// For some reason this is firing at the start, so don't bind until playback has begun
|
||||||
|
Events.on(this, 'ended', self.onPlaybackStopped);
|
||||||
|
Events.on(this, 'ended', self.playNextAfterEnded);
|
||||||
|
|
||||||
|
self.onPlaybackStart(this, self.currentItem, self.currentMediaSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPlaying() {
|
||||||
|
|
||||||
|
var videoControls = document.querySelector('#videoPlayer .videoControls');
|
||||||
|
var videoElement = document.querySelector('#videoPlayer #videoElement');
|
||||||
|
|
||||||
|
$('#video-playButton', videoControls).hide();
|
||||||
|
$('#video-pauseButton', videoControls).show();
|
||||||
|
$("#play", videoElement).show().addClass("fadeOut");
|
||||||
|
setTimeout(function () {
|
||||||
|
$("#play", videoElement).hide().removeClass("fadeOut");
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onVolumeChange() {
|
||||||
|
|
||||||
|
updateVolumeButtons(this.volume());
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPause() {
|
||||||
|
|
||||||
|
var videoControls = document.querySelector('#videoPlayer .videoControls');
|
||||||
|
var videoElement = document.querySelector('#videoPlayer #videoElement');
|
||||||
|
|
||||||
|
$('#video-playButton', videoControls).show();
|
||||||
|
$('#video-pauseButton', videoControls).hide();
|
||||||
|
$("#pause", videoElement).show().addClass("fadeOut");
|
||||||
|
setTimeout(function () {
|
||||||
|
$("#pause", videoElement).hide().removeClass("fadeOut");
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTimeUpdate() {
|
||||||
|
if (!positionSlider.dragging) {
|
||||||
|
|
||||||
|
self.setCurrentTime(self.getCurrentTicks(this), positionSlider, currentTimeElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onError() {
|
||||||
|
var errorMsg = Globalize.translate('MessageErrorPlayingVideo');
|
||||||
|
|
||||||
|
if (item.Type == "TvChannel") {
|
||||||
|
errorMsg += '<p>';
|
||||||
|
errorMsg += Globalize.translate('MessageEnsureOpenTuner');
|
||||||
|
errorMsg += '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
Dashboard.alert({
|
||||||
|
title: Globalize.translate('HeaderVideoError'),
|
||||||
|
message: errorMsg
|
||||||
|
});
|
||||||
|
|
||||||
|
self.onPlaybackStopped.call(mediaRenderer);
|
||||||
|
self.nextTrack();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onClick() {
|
||||||
|
|
||||||
|
if (!browserInfo.mobile) {
|
||||||
|
if (this.paused()) {
|
||||||
|
self.unpause();
|
||||||
|
} else {
|
||||||
|
self.pause();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDoubleClick() {
|
||||||
|
if (!browserInfo.mobile) {
|
||||||
|
self.toggleFullscreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.updatePlaylistUi = function () {
|
self.updatePlaylistUi = function () {
|
||||||
|
|
||||||
if (!initComplete) {
|
if (!initComplete) {
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
profile.TranscodingProfiles.push({
|
profile.TranscodingProfiles.push({
|
||||||
Container: 'mkv',
|
Container: 'mkv',
|
||||||
Type: 'Video',
|
Type: 'Video',
|
||||||
AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : ''),
|
AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : '') + (canPlayMp3 ? ',mp3' : ''),
|
||||||
VideoCodec: 'h264',
|
VideoCodec: 'h264',
|
||||||
Context: 'Streaming'
|
Context: 'Streaming'
|
||||||
});
|
});
|
||||||
|
@ -311,40 +311,6 @@
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!isVlc) {
|
|
||||||
profile.CodecProfiles.push({
|
|
||||||
Type: 'VideoAudio',
|
|
||||||
Codec: 'aac',
|
|
||||||
Container: 'mkv,mov',
|
|
||||||
Conditions: [
|
|
||||||
{
|
|
||||||
Condition: 'NotEquals',
|
|
||||||
Property: 'AudioProfile',
|
|
||||||
Value: 'HE-AAC'
|
|
||||||
}
|
|
||||||
// Disabling this is going to require us to learn why it was disabled in the first place
|
|
||||||
//,
|
|
||||||
//{
|
|
||||||
// Condition: 'NotEquals',
|
|
||||||
// Property: 'AudioProfile',
|
|
||||||
// Value: 'LC'
|
|
||||||
//}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
profile.CodecProfiles.push({
|
|
||||||
Type: 'VideoAudio',
|
|
||||||
Codec: 'aac',
|
|
||||||
Conditions: [
|
|
||||||
{
|
|
||||||
Condition: 'LessThanEqual',
|
|
||||||
Property: 'AudioChannels',
|
|
||||||
Value: '6'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
// These don't play very well
|
// These don't play very well
|
||||||
if (isVlc) {
|
if (isVlc) {
|
||||||
profile.CodecProfiles.push({
|
profile.CodecProfiles.push({
|
||||||
|
@ -358,6 +324,69 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'VideoAudio',
|
||||||
|
Codec: 'aac,mp3',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'LessThanEqual',
|
||||||
|
Property: 'AudioChannels',
|
||||||
|
Value: '6'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'VideoAudio',
|
||||||
|
Codec: 'aac',
|
||||||
|
Container: 'mkv,mov',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'NotEquals',
|
||||||
|
Property: 'AudioProfile',
|
||||||
|
Value: 'HE-AAC'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Condition: 'Equals',
|
||||||
|
Property: 'IsSecondaryAudio',
|
||||||
|
Value: 'false',
|
||||||
|
IsRequired: 'false'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Condition: 'LessThanEqual',
|
||||||
|
Property: 'AudioChannels',
|
||||||
|
Value: '6'
|
||||||
|
}
|
||||||
|
// Disabling this is going to require us to learn why it was disabled in the first place
|
||||||
|
//,
|
||||||
|
//{
|
||||||
|
// Condition: 'NotEquals',
|
||||||
|
// Property: 'AudioProfile',
|
||||||
|
// Value: 'LC'
|
||||||
|
//}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'VideoAudio',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'Equals',
|
||||||
|
Property: 'IsSecondaryAudio',
|
||||||
|
Value: 'false',
|
||||||
|
IsRequired: 'false'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Condition: 'LessThanEqual',
|
||||||
|
Property: 'AudioChannels',
|
||||||
|
Value: '6'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isVlc) {
|
if (isVlc) {
|
||||||
|
@ -543,6 +572,10 @@
|
||||||
|
|
||||||
self.playNextAfterEnded = function () {
|
self.playNextAfterEnded = function () {
|
||||||
|
|
||||||
|
console.log('playNextAfterEnded');
|
||||||
|
|
||||||
|
Events.off(this, 'ended', self.playNextAfterEnded);
|
||||||
|
|
||||||
self.nextTrack();
|
self.nextTrack();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -661,16 +694,18 @@
|
||||||
Events.off(mediaRenderer, 'ended', self.onPlaybackStopped);
|
Events.off(mediaRenderer, 'ended', self.onPlaybackStopped);
|
||||||
Events.off(mediaRenderer, 'ended', self.playNextAfterEnded);
|
Events.off(mediaRenderer, 'ended', self.playNextAfterEnded);
|
||||||
|
|
||||||
$(mediaRenderer).one("play", function () {
|
function onPlayingOnce() {
|
||||||
|
|
||||||
|
Events.off(this, "play", onPlayingOnce);
|
||||||
Events.on(this, 'ended', self.onPlaybackStopped);
|
Events.on(this, 'ended', self.onPlaybackStopped);
|
||||||
|
|
||||||
$(this).one('ended', self.playNextAfterEnded);
|
Events.on(this, 'ended', self.playNextAfterEnded);
|
||||||
|
|
||||||
self.startProgressInterval();
|
self.startProgressInterval();
|
||||||
sendProgressUpdate();
|
sendProgressUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
Events.on(mediaRenderer, "play", onPlayingOnce);
|
||||||
|
|
||||||
if (self.currentItem.MediaType == "Video") {
|
if (self.currentItem.MediaType == "Video") {
|
||||||
ApiClient.stopActiveEncodings(playSessionId).then(function () {
|
ApiClient.stopActiveEncodings(playSessionId).then(function () {
|
||||||
|
@ -958,13 +993,9 @@
|
||||||
|
|
||||||
if (mediaSource.TranscodingSubProtocol == 'hls') {
|
if (mediaSource.TranscodingSubProtocol == 'hls') {
|
||||||
|
|
||||||
if (mediaSource.RunTimeTicks) {
|
|
||||||
// Reports of stuttering with h264 stream copy in IE
|
|
||||||
mediaUrl += '&EnableAutoStreamCopy=false';
|
|
||||||
}
|
|
||||||
|
|
||||||
mediaUrl += seekParam;
|
mediaUrl += seekParam;
|
||||||
contentType = 'application/x-mpegURL';
|
contentType = 'application/x-mpegURL';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Reports of stuttering with h264 stream copy in IE
|
// Reports of stuttering with h264 stream copy in IE
|
||||||
|
@ -1044,7 +1075,7 @@
|
||||||
LocalAssetManager.translateFilePath(resultInfo.url).then(function (path) {
|
LocalAssetManager.translateFilePath(resultInfo.url).then(function (path) {
|
||||||
|
|
||||||
resultInfo.url = path;
|
resultInfo.url = path;
|
||||||
Logger.log('LocalAssetManager.translateFilePath: path: ' + resultInfo.url + ' result: ' + path);
|
console.log('LocalAssetManager.translateFilePath: path: ' + resultInfo.url + ' result: ' + path);
|
||||||
deferred.resolveWith(null, [resultInfo]);
|
deferred.resolveWith(null, [resultInfo]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1086,7 +1117,7 @@
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
ApiClient.detectBitrate().then(function (bitrate) {
|
ApiClient.detectBitrate().then(function (bitrate) {
|
||||||
Logger.log('Max bitrate auto detected to ' + bitrate);
|
console.log('Max bitrate auto detected to ' + bitrate);
|
||||||
self.lastBitrateDetections[bitrateDetectionKey] = new Date().getTime();
|
self.lastBitrateDetections[bitrateDetectionKey] = new Date().getTime();
|
||||||
AppSettings.maxStreamingBitrate(bitrate);
|
AppSettings.maxStreamingBitrate(bitrate);
|
||||||
|
|
||||||
|
@ -1295,7 +1326,7 @@
|
||||||
|
|
||||||
if (newItem) {
|
if (newItem) {
|
||||||
|
|
||||||
Logger.log('playing next track');
|
console.log('playing next track');
|
||||||
|
|
||||||
self.playInternal(newItem, 0, function () {
|
self.playInternal(newItem, 0, function () {
|
||||||
self.setPlaylistState(newIndex);
|
self.setPlaylistState(newIndex);
|
||||||
|
@ -1433,7 +1464,7 @@
|
||||||
|
|
||||||
if (self.currentMediaRenderer) {
|
if (self.currentMediaRenderer) {
|
||||||
|
|
||||||
Logger.log('MediaPlayer toggling mute');
|
console.log('MediaPlayer toggling mute');
|
||||||
|
|
||||||
if (self.volume()) {
|
if (self.volume()) {
|
||||||
self.mute();
|
self.mute();
|
||||||
|
@ -1462,7 +1493,7 @@
|
||||||
|
|
||||||
if (self.currentMediaRenderer) {
|
if (self.currentMediaRenderer) {
|
||||||
|
|
||||||
Logger.log('MediaPlayer setting volume to ' + val);
|
console.log('MediaPlayer setting volume to ' + val);
|
||||||
self.currentMediaRenderer.volume(val / 100);
|
self.currentMediaRenderer.volume(val / 100);
|
||||||
|
|
||||||
self.onVolumeChanged(self.currentMediaRenderer);
|
self.onVolumeChanged(self.currentMediaRenderer);
|
||||||
|
@ -1550,15 +1581,17 @@
|
||||||
|
|
||||||
if (mediaRenderer) {
|
if (mediaRenderer) {
|
||||||
|
|
||||||
mediaRenderer.stop();
|
|
||||||
|
|
||||||
Events.off(mediaRenderer, 'ended', self.playNextAfterEnded);
|
Events.off(mediaRenderer, 'ended', self.playNextAfterEnded);
|
||||||
|
|
||||||
$(mediaRenderer).one("ended", function () {
|
mediaRenderer.stop();
|
||||||
|
|
||||||
$(this).off('.mediaplayerevent');
|
Events.trigger(mediaRenderer, "ended");
|
||||||
|
//self.onPlaybackStopped.call(mediaRenderer);
|
||||||
|
|
||||||
this.cleanup(destroyRenderer);
|
// TODO: Unbind video events
|
||||||
|
unBindAudioEvents(mediaRenderer);
|
||||||
|
|
||||||
|
mediaRenderer.cleanup(destroyRenderer);
|
||||||
|
|
||||||
self.currentMediaRenderer = null;
|
self.currentMediaRenderer = null;
|
||||||
self.currentItem = null;
|
self.currentItem = null;
|
||||||
|
@ -1566,10 +1599,6 @@
|
||||||
self.currentSubtitleStreamIndex = null;
|
self.currentSubtitleStreamIndex = null;
|
||||||
self.streamInfo = {};
|
self.streamInfo = {};
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
Events.trigger(mediaRenderer, "ended");
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
self.currentMediaRenderer = null;
|
self.currentMediaRenderer = null;
|
||||||
self.currentItem = null;
|
self.currentItem = null;
|
||||||
|
@ -1583,6 +1612,14 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function unBindAudioEvents(mediaRenderer) {
|
||||||
|
|
||||||
|
Events.off(mediaRenderer, "volumechange", onVolumeChange);
|
||||||
|
Events.off(mediaRenderer, "pause", onPause);
|
||||||
|
Events.off(mediaRenderer, "playing", onPlaying);
|
||||||
|
Events.off(mediaRenderer, "timeupdate", onTimeUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
self.isPlaying = function () {
|
self.isPlaying = function () {
|
||||||
return self.playlist.length > 0;
|
return self.playlist.length > 0;
|
||||||
};
|
};
|
||||||
|
@ -1761,14 +1798,14 @@
|
||||||
|
|
||||||
self.onPlaybackStopped = function () {
|
self.onPlaybackStopped = function () {
|
||||||
|
|
||||||
Logger.log('playback stopped');
|
console.log('playback stopped');
|
||||||
|
|
||||||
document.body.classList.remove('bodyWithPopupOpen');
|
document.body.classList.remove('bodyWithPopupOpen');
|
||||||
|
|
||||||
var mediaRenderer = this;
|
var mediaRenderer = this;
|
||||||
|
|
||||||
Events.off(mediaRenderer, '.mediaplayerevent');
|
// TODO: Unbind other events
|
||||||
|
unBindAudioEvents(mediaRenderer);
|
||||||
Events.off(mediaRenderer, 'ended', self.onPlaybackStopped);
|
Events.off(mediaRenderer, 'ended', self.onPlaybackStopped);
|
||||||
|
|
||||||
var item = self.currentItem;
|
var item = self.currentItem;
|
||||||
|
@ -1790,6 +1827,8 @@
|
||||||
|
|
||||||
self.onPlaystateChange = function (mediaRenderer) {
|
self.onPlaystateChange = function (mediaRenderer) {
|
||||||
|
|
||||||
|
console.log('mediaplayer onPlaystateChange');
|
||||||
|
|
||||||
var state = self.getPlayerStateInternal(mediaRenderer, self.currentItem, self.currentMediaSource);
|
var state = self.getPlayerStateInternal(mediaRenderer, self.currentItem, self.currentMediaSource);
|
||||||
|
|
||||||
Events.trigger(self, 'playstatechange', [state]);
|
Events.trigger(self, 'playstatechange', [state]);
|
||||||
|
@ -1939,44 +1978,24 @@
|
||||||
poster: self.getPosterUrl(item)
|
poster: self.getPosterUrl(item)
|
||||||
});
|
});
|
||||||
|
|
||||||
Events.on(mediaRenderer, "volumechange.mediaplayerevent", function () {
|
function onPlayingOnce() {
|
||||||
|
|
||||||
Logger.log('audio element event: volumechange');
|
Events.off(mediaRenderer, "playing", onPlayingOnce);
|
||||||
|
|
||||||
self.onVolumeChanged(this);
|
console.log('audio element event: playing');
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$(mediaRenderer).one("playing.mediaplayerevent", function () {
|
|
||||||
|
|
||||||
Logger.log('audio element event: playing');
|
|
||||||
|
|
||||||
// For some reason this is firing at the start, so don't bind until playback has begun
|
// For some reason this is firing at the start, so don't bind until playback has begun
|
||||||
Events.on(this, 'ended', self.onPlaybackStopped);
|
Events.on(mediaRenderer, 'ended', self.onPlaybackStopped);
|
||||||
|
Events.on(mediaRenderer, 'ended', self.playNextAfterEnded);
|
||||||
|
|
||||||
$(this).one('ended', self.playNextAfterEnded);
|
self.onPlaybackStart(mediaRenderer, item, mediaSource);
|
||||||
|
}
|
||||||
|
|
||||||
self.onPlaybackStart(this, item, mediaSource);
|
Events.on(mediaRenderer, "volumechange", onVolumeChange);
|
||||||
|
Events.on(mediaRenderer, "playing", onPlayingOnce);
|
||||||
}).on("pause.mediaplayerevent", function () {
|
Events.on(mediaRenderer, "pause", onPause);
|
||||||
|
Events.on(mediaRenderer, "playing", onPlaying);
|
||||||
Logger.log('audio element event: pause');
|
Events.on(mediaRenderer, "timeupdate", onTimeUpdate);
|
||||||
|
|
||||||
self.onPlaystateChange(this);
|
|
||||||
|
|
||||||
// In the event timeupdate isn't firing, at least we can update when this happens
|
|
||||||
self.setCurrentTime(self.getCurrentTicks());
|
|
||||||
|
|
||||||
}).on("playing.mediaplayerevent", function () {
|
|
||||||
|
|
||||||
Logger.log('audio element event: playing');
|
|
||||||
|
|
||||||
self.onPlaystateChange(this);
|
|
||||||
|
|
||||||
// In the event timeupdate isn't firing, at least we can update when this happens
|
|
||||||
self.setCurrentTime(self.getCurrentTicks());
|
|
||||||
|
|
||||||
}).on("timeupdate.mediaplayerevent", onTimeUpdate);
|
|
||||||
|
|
||||||
self.currentMediaRenderer = mediaRenderer;
|
self.currentMediaRenderer = mediaRenderer;
|
||||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||||
|
@ -1994,6 +2013,34 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onVolumeChange() {
|
||||||
|
console.log('audio element event: pause');
|
||||||
|
|
||||||
|
self.onPlaystateChange(this);
|
||||||
|
|
||||||
|
// In the event timeupdate isn't firing, at least we can update when this happens
|
||||||
|
self.setCurrentTime(self.getCurrentTicks());
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPause() {
|
||||||
|
|
||||||
|
console.log('audio element event: pause');
|
||||||
|
|
||||||
|
self.onPlaystateChange(this);
|
||||||
|
|
||||||
|
// In the event timeupdate isn't firing, at least we can update when this happens
|
||||||
|
self.setCurrentTime(self.getCurrentTicks());
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPlaying() {
|
||||||
|
console.log('audio element event: playing');
|
||||||
|
|
||||||
|
self.onPlaystateChange(this);
|
||||||
|
|
||||||
|
// In the event timeupdate isn't firing, at least we can update when this happens
|
||||||
|
self.setCurrentTime(self.getCurrentTicks());
|
||||||
|
}
|
||||||
|
|
||||||
var getItemFields = "MediaSources,Chapters";
|
var getItemFields = "MediaSources,Chapters";
|
||||||
|
|
||||||
self.tryPair = function (target) {
|
self.tryPair = function (target) {
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
||||||
|
|
||||||
updateFilterControls(page);
|
updateFilterControls(page);
|
||||||
var trigger = false;
|
|
||||||
|
|
||||||
if (view == "Thumb") {
|
if (view == "Thumb") {
|
||||||
html = LibraryBrowser.getPosterViewHtml({
|
html = LibraryBrowser.getPosterViewHtml({
|
||||||
|
@ -112,7 +111,6 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
sortBy: query.SortBy
|
sortBy: query.SortBy
|
||||||
});
|
});
|
||||||
trigger = true;
|
|
||||||
}
|
}
|
||||||
else if (view == "Poster") {
|
else if (view == "Poster") {
|
||||||
html = LibraryBrowser.getPosterViewHtml({
|
html = LibraryBrowser.getPosterViewHtml({
|
||||||
|
@ -150,10 +148,6 @@
|
||||||
elem.innerHTML = html + pagingHtml;
|
elem.innerHTML = html + pagingHtml;
|
||||||
ImageLoader.lazyChildren(elem);
|
ImageLoader.lazyChildren(elem);
|
||||||
|
|
||||||
if (trigger) {
|
|
||||||
Events.trigger(elem, 'create');
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.btnNextPage', page).on('click', function () {
|
$('.btnNextPage', page).on('click', function () {
|
||||||
query.StartIndex += query.Limit;
|
query.StartIndex += query.Limit;
|
||||||
reloadItems(page, viewPanel);
|
reloadItems(page, viewPanel);
|
||||||
|
|
|
@ -370,13 +370,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(MediaController).on('playbackstop', onPlaybackStop);
|
Events.on(MediaController, 'playbackstop', onPlaybackStop);
|
||||||
});
|
});
|
||||||
|
|
||||||
pageIdOn('pagebeforehide', "moviesPage", function () {
|
pageIdOn('pagebeforehide', "moviesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
$(MediaController).off('playbackstop', onPlaybackStop);
|
Events.off(MediaController, 'playbackstop', onPlaybackStop);
|
||||||
});
|
});
|
||||||
|
|
||||||
function onPlaybackStop(e, state) {
|
function onPlaybackStop(e, state) {
|
||||||
|
|
|
@ -66,7 +66,6 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
shape: "backdrop",
|
shape: "backdrop",
|
||||||
preferThumb: true,
|
preferThumb: true,
|
||||||
context: 'music',
|
|
||||||
showItemCounts: true,
|
showItemCounts: true,
|
||||||
lazy: true,
|
lazy: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
|
@ -79,13 +78,21 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
shape: "backdrop",
|
shape: "backdrop",
|
||||||
preferThumb: true,
|
preferThumb: true,
|
||||||
context: 'music',
|
|
||||||
showItemCounts: true,
|
showItemCounts: true,
|
||||||
cardLayout: true,
|
cardLayout: true,
|
||||||
lazy: true,
|
lazy: true,
|
||||||
showTitle: true
|
showTitle: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else if (view == "Poster") {
|
||||||
|
html = LibraryBrowser.getPosterViewHtml({
|
||||||
|
items: result.Items,
|
||||||
|
shape: "portrait",
|
||||||
|
centerText: true,
|
||||||
|
showItemCounts: true,
|
||||||
|
lazy: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var elem = page.querySelector('#items');
|
var elem = page.querySelector('#items');
|
||||||
elem.innerHTML = html;
|
elem.innerHTML = html;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
ApiClient.getUser(userId).then(function (user) {
|
ApiClient.getUser(userId).then(function (user) {
|
||||||
|
|
||||||
$('.username', page).html(user.Name);
|
$('.username', page).html(user.Name);
|
||||||
Events.trigger($('#uploadUserImage', page).val('')[0], 'change');
|
$('#uploadUserImage', page).val('').trigger('change');
|
||||||
|
|
||||||
Dashboard.setPageTitle(user.Name);
|
Dashboard.setPageTitle(user.Name);
|
||||||
|
|
||||||
|
|
|
@ -177,14 +177,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeApiClient(apiClient) {
|
function initializeApiClient(apiClient) {
|
||||||
$(apiClient).off("websocketmessage", onWebSocketMessage).on("websocketmessage", onWebSocketMessage);
|
Events.off(apiClient, "websocketmessage", onWebSocketMessage);
|
||||||
|
Events.on(apiClient, "websocketmessage", onWebSocketMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.ApiClient) {
|
if (window.ApiClient) {
|
||||||
initializeApiClient(window.ApiClient);
|
initializeApiClient(window.ApiClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
Events.on(ConnectionManager, 'apiclientcreated', function (e, apiClient) {
|
||||||
initializeApiClient(apiClient);
|
initializeApiClient(apiClient);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return height + 'px';
|
return height + 'px';
|
||||||
return '80px';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function slideDown(elem) {
|
function slideDown(elem) {
|
||||||
|
@ -97,8 +96,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
onfinish();
|
|
||||||
return;
|
|
||||||
requestAnimationFrame(function () {
|
requestAnimationFrame(function () {
|
||||||
var keyframes = [
|
var keyframes = [
|
||||||
{ height: getHeight(elem), offset: 0 },
|
{ height: getHeight(elem), offset: 0 },
|
||||||
|
@ -119,7 +116,6 @@
|
||||||
if (!browserInfo.animate || browserInfo.mobile) {
|
if (!browserInfo.animate || browserInfo.mobile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
|
|
||||||
requestAnimationFrame(function () {
|
requestAnimationFrame(function () {
|
||||||
|
|
||||||
|
@ -541,7 +537,7 @@
|
||||||
|
|
||||||
function onPlaybackStart(e, state) {
|
function onPlaybackStart(e, state) {
|
||||||
|
|
||||||
Logger.log('nowplaying event: ' + e.type);
|
console.log('nowplaying event: ' + e.type);
|
||||||
|
|
||||||
var player = this;
|
var player = this;
|
||||||
|
|
||||||
|
@ -569,7 +565,7 @@
|
||||||
|
|
||||||
function onPlaybackStopped(e, state) {
|
function onPlaybackStopped(e, state) {
|
||||||
|
|
||||||
Logger.log('nowplaying event: ' + e.type);
|
console.log('nowplaying event: ' + e.type);
|
||||||
var player = this;
|
var player = this;
|
||||||
|
|
||||||
player.endPlayerUpdates();
|
player.endPlayerUpdates();
|
||||||
|
@ -579,7 +575,7 @@
|
||||||
|
|
||||||
function onStateChanged(e, state) {
|
function onStateChanged(e, state) {
|
||||||
|
|
||||||
//Logger.log('nowplaying event: ' + e.type);
|
//console.log('nowplaying event: ' + e.type);
|
||||||
var player = this;
|
var player = this;
|
||||||
|
|
||||||
if (player.isDefaultPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
if (player.isDefaultPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||||
|
@ -593,11 +589,11 @@
|
||||||
|
|
||||||
if (currentPlayer) {
|
if (currentPlayer) {
|
||||||
|
|
||||||
$(currentPlayer).off('playbackstart', onPlaybackStart)
|
Events.off(currentPlayer, 'playbackstart', onPlaybackStart);
|
||||||
.off('playbackstop', onPlaybackStopped)
|
Events.off(currentPlayer, 'playbackstop', onPlaybackStopped);
|
||||||
.off('volumechange', onVolumeChanged)
|
Events.off(currentPlayer, 'volumechange', onVolumeChanged);
|
||||||
.off('playstatechange', onStateChanged)
|
Events.off(currentPlayer, 'playstatechange', onStateChanged);
|
||||||
.off('positionchange', onStateChanged);
|
Events.off(currentPlayer, 'positionchange', onStateChanged);
|
||||||
|
|
||||||
currentPlayer.endPlayerUpdates();
|
currentPlayer.endPlayerUpdates();
|
||||||
currentPlayer = null;
|
currentPlayer = null;
|
||||||
|
@ -637,11 +633,11 @@
|
||||||
onStateChanged.call(player, { type: 'init' }, state);
|
onStateChanged.call(player, { type: 'init' }, state);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(player).on('playbackstart', onPlaybackStart)
|
Events.on(player, 'playbackstart', onPlaybackStart);
|
||||||
.on('playbackstop', onPlaybackStopped)
|
Events.on(player, 'playbackstop', onPlaybackStopped);
|
||||||
.on('volumechange', onVolumeChanged)
|
Events.on(player, 'volumechange', onVolumeChanged);
|
||||||
.on('playstatechange', onStateChanged)
|
Events.on(player, 'playstatechange', onStateChanged);
|
||||||
.on('positionchange', onStateChanged);
|
Events.on(player, 'positionchange', onStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.on(MediaController, 'playerchange', function () {
|
Events.on(MediaController, 'playerchange', function () {
|
||||||
|
|
|
@ -605,8 +605,8 @@
|
||||||
|
|
||||||
// This should be outside of the IF
|
// This should be outside of the IF
|
||||||
// But for now, if you change songs but keep the same artist, the backdrop will flicker because in-between songs it clears out the image
|
// But for now, if you change songs but keep the same artist, the backdrop will flicker because in-between songs it clears out the image
|
||||||
if (!browserInfo.safari) {
|
if (!browserInfo.mobile) {
|
||||||
// Exclude from safari because it just doesn't perform well
|
// Exclude from mobile because it just doesn't perform well
|
||||||
Backdrops.setBackdropUrl(page, backdropUrl);
|
Backdrops.setBackdropUrl(page, backdropUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,11 +637,11 @@
|
||||||
|
|
||||||
if (currentPlayer) {
|
if (currentPlayer) {
|
||||||
|
|
||||||
$(currentPlayer).off('playbackstart', onPlaybackStart)
|
Events.off(currentPlayer, 'playbackstart', onPlaybackStart);
|
||||||
.off('playbackstop', onPlaybackStopped)
|
Events.off(currentPlayer, 'playbackstop', onPlaybackStopped);
|
||||||
.off('volumechange', onStateChanged)
|
Events.off(currentPlayer, 'volumechange', onStateChanged);
|
||||||
.off('playstatechange', onStateChanged)
|
Events.off(currentPlayer, 'playstatechange', onStateChanged);
|
||||||
.off('positionchange', onStateChanged);
|
Events.off(currentPlayer, 'positionchange', onStateChanged);
|
||||||
|
|
||||||
currentPlayer.endPlayerUpdates();
|
currentPlayer.endPlayerUpdates();
|
||||||
currentPlayer = null;
|
currentPlayer = null;
|
||||||
|
@ -663,11 +663,11 @@
|
||||||
onStateChanged.call(player, { type: 'init' }, state);
|
onStateChanged.call(player, { type: 'init' }, state);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(player).on('playbackstart', onPlaybackStart)
|
Events.on(player, 'playbackstart', onPlaybackStart);
|
||||||
.on('playbackstop', onPlaybackStopped)
|
Events.on(player, 'playbackstop', onPlaybackStopped);
|
||||||
.on('volumechange', onStateChanged)
|
Events.on(player, 'volumechange', onStateChanged);
|
||||||
.on('playstatechange', onStateChanged)
|
Events.on(player, 'playstatechange', onStateChanged);
|
||||||
.on('positionchange', onStateChanged);
|
Events.on(player, 'positionchange', onStateChanged);
|
||||||
|
|
||||||
var playerInfo = MediaController.getPlayerInfo();
|
var playerInfo = MediaController.getPlayerInfo();
|
||||||
|
|
||||||
|
@ -820,7 +820,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(MediaController).on('playerchange', function () {
|
Events.on(MediaController, 'playerchange', function () {
|
||||||
updateCastIcon(page);
|
updateCastIcon(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -832,7 +832,7 @@
|
||||||
|
|
||||||
currentImgUrl = null;
|
currentImgUrl = null;
|
||||||
|
|
||||||
$(MediaController).on('playerchange', onPlayerChange);
|
Events.on(MediaController, 'playerchange', onPlayerChange);
|
||||||
|
|
||||||
bindToPlayer(page, MediaController.getCurrentPlayer());
|
bindToPlayer(page, MediaController.getCurrentPlayer());
|
||||||
|
|
||||||
|
@ -861,7 +861,7 @@
|
||||||
|
|
||||||
releaseCurrentPlayer();
|
releaseCurrentPlayer();
|
||||||
|
|
||||||
$(MediaController).off('playerchange', onPlayerChange);
|
Events.off(MediaController, 'playerchange', onPlayerChange);
|
||||||
|
|
||||||
lastPlayerState = null;
|
lastPlayerState = null;
|
||||||
$(document.body).removeClass('hiddenViewMenuBar').removeClass('hiddenNowPlayingBar');
|
$(document.body).removeClass('hiddenViewMenuBar').removeClass('hiddenNowPlayingBar');
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
options.callback(review);
|
options.callback(review);
|
||||||
} else Logger.log("No callback function provided");
|
} else console.log("No callback function provided");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
id: id,
|
id: id,
|
||||||
rating: rating,
|
rating: rating,
|
||||||
callback: function (review) {
|
callback: function (review) {
|
||||||
Logger.log(review);
|
console.log(review);
|
||||||
dialog.close();
|
dialog.close();
|
||||||
|
|
||||||
ApiClient.createPackageReview(review).then(function () {
|
ApiClient.createPackageReview(review).then(function () {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue