Merge pull request #2425 from MediaBrowser/beta

Beta
This commit is contained in:
Luke 2017-01-26 15:40:15 -05:00 committed by GitHub
commit 2a54497fe5
304 changed files with 15220 additions and 10808 deletions

View File

@ -16,12 +16,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.1.107", "version": "1.1.125",
"_release": "1.1.107", "_release": "1.1.125",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.1.107", "tag": "1.1.125",
"commit": "82a9be9ffc4359043cbbae83031491dc4d2182cc" "commit": "de914c8db94b994ea45746626ba73bfb72a594a0"
}, },
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git", "_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "^1.1.51", "_target": "^1.1.51",

View File

@ -589,7 +589,8 @@
var url = self.getUrl("socket"); var url = self.getUrl("socket");
url = replaceAll(url, 'emby/socket', 'embywebsocket'); url = replaceAll(url, 'emby/socket', 'embywebsocket');
url = replaceAll(url, 'http', 'ws'); url = replaceAll(url, 'https:', 'wss:');
url = replaceAll(url, 'http:', 'ws:');
url += "?api_key=" + accessToken; url += "?api_key=" + accessToken;
url += "&deviceId=" + deviceId; url += "&deviceId=" + deviceId;
@ -1407,6 +1408,26 @@
return self.getJSON(url); return self.getJSON(url);
}; };
self.getPlaybackInfo = function(itemId, options, deviceProfile) {
var postData = {
DeviceProfile: deviceProfile
};
return self.ajax({
url: self.getUrl('Items/' + itemId + '/PlaybackInfo', options),
type: 'POST',
data: JSON.stringify(postData),
contentType: "application/json",
dataType: "json"
});
};
self.getIntros = function(itemId) {
return self.getJSON(self.getUrl('Users/' + self.getCurrentUserId() + '/Items/' + itemId + '/Intros'));
};
/** /**
* Gets the directory contents of a path on the server * Gets the directory contents of a path on the server
*/ */
@ -2122,6 +2143,19 @@
return self.getJSON(url); return self.getJSON(url);
}; };
self.getItemDownloadUrl = function (itemId) {
if (!itemId) {
throw new Error("itemId cannot be empty");
}
var url = "Items/" + itemId + "/Download";
return self.getUrl(url, {
api_key: self.accessToken()
});
};
self.getSessions = function (options) { self.getSessions = function (options) {
var url = self.getUrl("Sessions", options); var url = self.getUrl("Sessions", options);
@ -2617,9 +2651,10 @@
var url = self.getUrl("Users/authenticatebyname"); var url = self.getUrl("Users/authenticatebyname");
require(["cryptojs-sha1"], function () { require(["cryptojs-sha1", "cryptojs-md5"], function () {
var postData = { var postData = {
password: CryptoJS.SHA1(password || "").toString(), Password: CryptoJS.SHA1(password || "").toString(),
PasswordMd5: CryptoJS.MD5(password || "").toString(),
Username: name Username: name
}; };

View File

@ -0,0 +1,373 @@
define(['apiclientcore', 'localassetmanager', 'events'], function (apiclientcorefactory, localassetmanager, events) {
'use strict';
var localPrefix = 'local:';
var localViewPrefix = 'localview:';
/**
* Creates a new api client instance
* @param {String} serverAddress
* @param {String} clientName s
* @param {String} applicationVersion
*/
return function (serverAddress, clientName, applicationVersion, deviceName, deviceId, devicePixelRatio) {
var apiclientcore = new apiclientcorefactory(serverAddress, clientName, applicationVersion, deviceName, deviceId, devicePixelRatio);
var self = Object.assign(this, apiclientcore);
events.on(apiclientcore, 'websocketmessage', onWebSocketMessage);
Object.defineProperty(self, 'onAuthenticated', {
get: function () { return apiclientcore.onAuthenticated; },
set: function (newValue) { apiclientcore.onAuthenticated = newValue; }
});
Object.defineProperty(self, 'enableAutomaticBitrateDetection', {
get: function () { return apiclientcore.enableAutomaticBitrateDetection; },
set: function (newValue) { apiclientcore.enableAutomaticBitrateDetection = newValue; }
});
function getUserViews(userId) {
return apiclientcore.getUserViews(userId).then(function (result) {
var serverInfo = apiclientcore.serverInfo();
if (serverInfo) {
return getLocalView(serverInfo.Id, userId).then(function (localView) {
if (localView) {
result.Items.push(localView);
result.TotalRecordCount++;
}
return Promise.resolve(result);
});
}
return Promis.resolve(result);
});
}
function getLocalView(serverId, userId) {
return localassetmanager.getViews(serverId, userId).then(function (views) {
var localView = null;
if (views.length > 0) {
localView = {
Name: 'Offline Items',
ServerId: serverId,
Id: 'localview',
Type: 'localview'
};
}
return Promise.resolve(localView);
});
}
function getItems(userId, options) {
var serverInfo = apiclientcore.serverInfo();
var i;
if (serverInfo && options.ParentId === 'localview') {
return localassetmanager.getViews(serverInfo.Id, userId).then(function (items) {
var result = {
Items: items,
TotalRecordCount: items.length
};
return Promise.resolve(result);
});
} else if (serverInfo && options && (startsWith(options.ParentId, localViewPrefix) || startsWith(options.ParentId, localPrefix))) {
return localassetmanager.getViewItems(serverInfo.Id, userId, options.ParentId).then(function (items) {
items.forEach(function (item) {
item.Id = localPrefix + item.Id;
});
items.sort(function (a, b) { return a.SortName.toLowerCase().localeCompare(b.SortName.toLowerCase()); });
var result = {
Items: items,
TotalRecordCount: items.length
};
return Promise.resolve(result);
});
} else if (options && options.ExcludeItemIds && options.ExcludeItemIds.length) {
var exItems = options.ExcludeItemIds.split(',');
for (i = 0; i < exItems.length; i++) {
if (startsWith(exItems[i], localPrefix)) {
return Promise.resolve(createEmptyList());
}
}
} else if (options && options.Ids && options.Ids.length) {
var ids = options.Ids.split(',');
var hasLocal = false;
for (i = 0; i < ids.length; i++) {
if (startsWith(ids[i], localPrefix)) {
hasLocal = true;
}
}
if (hasLocal) {
return localassetmanager.getItemsFromIds(serverInfo.Id, ids).then(function (items) {
items.forEach(function (item) {
item.Id = localPrefix + item.Id;
});
var result = {
Items: items,
TotalRecordCount: items.length
};
return Promise.resolve(result);
});
}
}
return apiclientcore.getItems(userId, options);
}
function getItem(userId, itemId) {
if (itemId) {
itemId = itemId.toString();
}
var serverInfo;
if (startsWith(itemId, localViewPrefix)) {
serverInfo = apiclientcore.serverInfo();
if (serverInfo) {
return localassetmanager.getViews(serverInfo.Id, userId).then(function (items) {
var views = items.filter(function (item) {
return item.Id === itemId;
});
if (views.length > 0) {
return Promise.resolve(views[0]);
}
// TODO: Test consequence of this
return Promise.reject();
});
}
}
if (startsWith(itemId, localPrefix)) {
serverInfo = apiclientcore.serverInfo();
if (serverInfo) {
return localassetmanager.getLocalItem(serverInfo.Id, stripStart(itemId, localPrefix)).then(function (item) {
item.Item.Id = localPrefix + item.Item.Id;
return Promise.resolve(item.Item);
});
}
}
return apiclientcore.getItem(userId, itemId);
}
function getNextUpEpisodes(options) {
if (options.SeriesId) {
if (startsWith(options.SeriesId, localPrefix)) {
return Promise.resolve(createEmptyList());
}
}
return apiclientcore.getNextUpEpisodes(options);
}
function getSeasons(itemId, options) {
if (startsWith(itemId, localPrefix)) {
options.ParentId = itemId;
return getItems(apiclientcore.getCurrentUserId(), options);
}
return apiclientcore.getSeasons(itemId, options);
}
function getEpisodes(itemId, options) {
if (startsWith(options.SeasonId, localPrefix)) {
options.ParentId = options.SeasonId;
return getItems(apiclientcore.getCurrentUserId(), options);
}
return apiclientcore.getEpisodes(itemId, options);
}
function getThemeMedia(userId, itemId, inherit) {
if (startsWith(itemId, localViewPrefix) || startsWith(itemId, localPrefix)) {
return Promise.reject();
}
return apiclientcore.getThemeMedia(userId, itemId, inherit);
}
function getSimilarItems(itemId, options) {
if (startsWith(itemId, localPrefix)) {
return Promise.resolve(createEmptyList());
}
return apiclientcore.getSimilarItems(itemId, options);
}
function updateFavoriteStatus(userId, itemId, isFavorite) {
if (startsWith(itemId, localPrefix)) {
return Promise.resolve();
}
return apiclientcore.updateFavoriteStatus(userId, itemId, isFavorite);
}
function getScaledImageUrl(itemId, options) {
if (startsWith(itemId, localPrefix)) {
var serverInfo = apiclientcore.serverInfo();
var id = stripStart(itemId, localPrefix);
return localassetmanager.getImageUrl(serverInfo.Id, id, options.type, 0);
}
return apiclientcore.getScaledImageUrl(itemId, options);
}
function onWebSocketMessage(e, msg) {
events.trigger(self, 'websocketmessage', [msg]);
}
// **************** Helper functions
function startsWith(str, find) {
if (str && find && str.length > find.length) {
if (str.indexOf(find) === 0) {
return true;
}
}
return false;
}
function stripStart(str, find) {
if (startsWith(str, find)) {
return str.substr(find.length);
}
return str;
}
function createEmptyList() {
var result = {
Items: [],
TotalRecordCount: 0
};
return result;
}
function getPlaybackInfo(itemId, options, deviceProfile) {
return localassetmanager.getLocalItem(apiclientcore.serverId(), stripStart(itemId, localPrefix)).then(function (item) {
// TODO: This was already done during the sync process, right? If so, remove it
var mediaSources = item.Item.MediaSources.map(function (m) {
m.SupportsDirectPlay = true;
m.SupportsDirectStream = false;
m.SupportsTranscoding = false;
return m;
});
return {
MediaSources: mediaSources
};
});
}
// "Override" methods
self.detectBitrate = function () {
return Promise.reject();
};
self.reportPlaybackStart = function (options) {
if (!options) {
throw new Error("null options");
}
return Promise.resolve();
};
self.reportPlaybackProgress = function (options) {
if (!options) {
throw new Error("null options");
}
return Promise.resolve();
};
self.reportPlaybackStopped = function (options) {
if (!options) {
throw new Error("null options");
}
return Promise.resolve();
};
self.getIntros = function (itemId) {
return Promise.resolve({
Items: [],
TotalRecordCount: 0
});
};
self.getUserViews = getUserViews;
self.getItems = getItems;
self.getItem = getItem;
self.getSeasons = getSeasons;
self.getEpisodes = getEpisodes;
self.getThemeMedia = getThemeMedia;
self.getNextUpEpisodes = getNextUpEpisodes;
self.getSimilarItems = getSimilarItems;
self.updateFavoriteStatus = updateFavoriteStatus;
self.getScaledImageUrl = getScaledImageUrl;
self.getPlaybackInfo = getPlaybackInfo;
};
});

View File

@ -216,7 +216,7 @@
return connectUser; return connectUser;
}; };
var minServerVersion = '3.0.7200'; var minServerVersion = '3.0.8500';
self.minServerVersion = function (val) { self.minServerVersion = function (val) {
if (val) { if (val) {
@ -251,6 +251,10 @@
return credentialProvider.credentials().ConnectAccessToken; return credentialProvider.credentials().ConnectAccessToken;
}; };
self.getApiClients = function () {
return apiClients;
};
self.getServerInfo = function (id) { self.getServerInfo = function (id) {
var servers = credentialProvider.credentials().Servers; var servers = credentialProvider.credentials().Servers;
@ -353,6 +357,8 @@
function onConnectUserSignIn(user) { function onConnectUserSignIn(user) {
appStorage.removeItem('lastLocalServerId');
connectUser = user; connectUser = user;
events.trigger(self, 'connectusersignedin', [user]); events.trigger(self, 'connectusersignedin', [user]);
} }
@ -458,6 +464,12 @@
function onLocalUserSignIn(server, connectionMode, user) { function onLocalUserSignIn(server, connectionMode, user) {
if (self.connectUserId()) {
appStorage.removeItem('lastLocalServerId');
} else {
appStorage.setItem('lastLocalServerId', server.Id);
}
// Ensure this is created so that listeners of the event can get the apiClient instance // Ensure this is created so that listeners of the event can get the apiClient instance
getOrAddApiClient(server, connectionMode); getOrAddApiClient(server, connectionMode);
@ -471,29 +483,26 @@
function ensureConnectUser(credentials) { function ensureConnectUser(credentials) {
return new Promise(function (resolve, reject) { if (connectUser && connectUser.Id === credentials.ConnectUserId) {
return Promise.resolve();
}
if (connectUser && connectUser.Id === credentials.ConnectUserId) { else if (credentials.ConnectUserId && credentials.ConnectAccessToken) {
resolve();
}
else if (credentials.ConnectUserId && credentials.ConnectAccessToken) { connectUser = null;
connectUser = null; return getConnectUser(credentials.ConnectUserId, credentials.ConnectAccessToken).then(function (user) {
getConnectUser(credentials.ConnectUserId, credentials.ConnectAccessToken).then(function (user) { onConnectUserSignIn(user);
return Promise.resolve();
onConnectUserSignIn(user); }, function () {
resolve(); return Promise.resolve();
});
}, function () { } else {
resolve(); return Promise.resolve();
}); }
} else {
resolve();
}
});
} }
function getConnectUrl(handler) { function getConnectUrl(handler) {
@ -728,6 +737,10 @@
} }
} }
if (credentials.ConnectAccessToken) {
appStorage.removeItem('lastLocalServerId');
}
credentials.Servers = servers; credentials.Servers = servers;
credentials.ConnectAccessToken = null; credentials.ConnectAccessToken = null;
credentials.ConnectUserId = null; credentials.ConnectUserId = null;
@ -926,9 +939,18 @@
console.log('Begin connectToServers, with ' + servers.length + ' servers'); console.log('Begin connectToServers, with ' + servers.length + ' servers');
if (servers.length === 1) { var defaultServer = servers.length === 1 ? servers[0] : null;
return self.connectToServer(servers[0], options).then(function (result) { if (!defaultServer) {
var lastLocalServerId = appStorage.getItem('lastLocalServerId');
defaultServer = servers.filter(function (s) {
return s.Id === lastLocalServerId;
})[0];
}
if (defaultServer) {
return self.connectToServer(defaultServer, options).then(function (result) {
if (result.State === ConnectionState.Unavailable) { if (result.State === ConnectionState.Unavailable) {

View File

@ -66,6 +66,26 @@
}); });
} }
function getItemsFromIds(serverId, ids) {
var actions = ids.map(function (id) {
var strippedId = stripStart(id, 'local:');
return getLocalItem(serverId, strippedId);
});
return Promise.all(actions).then(function (items) {
var libItems = items.map(function (locItem) {
return locItem.Item;
});
return Promise.resolve(libItems);
});
}
function getViews(serverId, userId) { function getViews(serverId, userId) {
return itemrepository.getServerItemTypes(serverId, userId).then(function (types) { return itemrepository.getServerItemTypes(serverId, userId).then(function (types) {
@ -80,7 +100,7 @@
ServerId: serverId, ServerId: serverId,
Id: 'localview:MusicView', Id: 'localview:MusicView',
Type: 'MusicView', Type: 'MusicView',
CollectionType: 'Music', CollectionType: 'music',
IsFolder: true IsFolder: true
}; };
@ -94,7 +114,7 @@
ServerId: serverId, ServerId: serverId,
Id: 'localview:PhotosView', Id: 'localview:PhotosView',
Type: 'PhotosView', Type: 'PhotosView',
CollectionType: 'Photos', CollectionType: 'photos',
IsFolder: true IsFolder: true
}; };
@ -108,23 +128,49 @@
ServerId: serverId, ServerId: serverId,
Id: 'localview:TVView', Id: 'localview:TVView',
Type: 'TVView', Type: 'TVView',
CollectionType: 'TvShows', CollectionType: 'tvshows',
IsFolder: true IsFolder: true
}; };
list.push(item); list.push(item);
} }
if (types.indexOf('video') > -1 || if (types.indexOf('movie') > -1) {
types.indexOf('movie') > -1 ||
types.indexOf('musicvideo') > -1) { item = {
Name: 'Movies',
ServerId: serverId,
Id: 'localview:MoviesView',
Type: 'MoviesView',
CollectionType: 'movies',
IsFolder: true
};
list.push(item);
}
if (types.indexOf('video') > -1) {
item = { item = {
Name: 'Videos', Name: 'Videos',
ServerId: serverId, ServerId: serverId,
Id: 'localview:VideosView', Id: 'localview:VideosView',
Type: 'VideosView', Type: 'VideosView',
CollectionType: 'HomeVideos', CollectionType: 'videos',
IsFolder: true
};
list.push(item);
}
if (types.indexOf('musicvideo') > -1) {
item = {
Name: 'Music Videos',
ServerId: serverId,
Id: 'localview:MusicVideosView',
Type: 'MusicVideosView',
CollectionType: 'videos',
IsFolder: true IsFolder: true
}; };
@ -135,28 +181,80 @@
}); });
} }
function getTypeFilterForTopLevelView(parentId) {
var typeFilter = null;
switch (parentId) {
case 'localview:MusicView':
typeFilter = 'audio';
break;
case 'localview:PhotosView':
typeFilter = 'photo';
break;
case 'localview:TVView':
typeFilter = 'episode';
break;
case 'localview:VideosView':
typeFilter = 'video';
break;
case 'localview:MoviesView':
typeFilter = 'movie';
break;
case 'localview:MusicVideosView':
typeFilter = 'musicvideo';
break;
}
return typeFilter;
}
function getViewItems(serverId, userId, parentId) { function getViewItems(serverId, userId, parentId) {
var typeFilter = getTypeFilterForTopLevelView(parentId);
parentId = stripStart(parentId, 'localview:');
parentId = stripStart(parentId, 'local:');
return getServerItems(serverId).then(function (items) { return getServerItems(serverId).then(function (items) {
var resultItems = items.filter(function (item) { var resultItemIds = items.filter(function (item) {
var type = (item.Item.Type || '').toLowerCase(); if (item.SyncStatus && item.SyncStatus !== 'synced') {
return false;
switch (parentId) {
case 'localview:MusicView':
return type === 'audio';
case 'localview:PhotosView':
return type === 'photo';
case 'localview:TVView':
return type === 'episode';
case 'localview:VideosView':
return type === 'movie' || type === 'video' || type === 'musicvideo';
default:
return false;
} }
if (typeFilter) {
var type = (item.Item.Type || '').toLowerCase();
return typeFilter === type;
}
return item.Item.ParentId === parentId;
}).map(function (item2) { }).map(function (item2) {
return item2.Item;
switch (typeFilter) {
case 'audio':
case 'photo':
return item2.Item.AlbumId;
case 'episode':
return item2.Item.SeriesId;
}
return item2.Item.Id;
}).filter(filterDistinct);
var resultItems = [];
items.forEach(function (item) {
var found = false;
resultItemIds.forEach(function (id) {
if (item.Item.Id === id) {
resultItems.push(item.Item);
}
});
}); });
return Promise.resolve(resultItems); return Promise.resolve(resultItems);
@ -203,7 +301,14 @@
} }
function addOrUpdateLocalItem(localItem) { function addOrUpdateLocalItem(localItem) {
return itemrepository.set(localItem.Id, localItem); console.log('addOrUpdateLocalItem Start');
return itemrepository.set(localItem.Id, localItem).then(function (res) {
console.log('addOrUpdateLocalItem Success');
return Promise.resolve(true);
}, function (error) {
console.log('addOrUpdateLocalItem Error');
return Promise.resolve(false);
});
} }
function createLocalItem(libraryItem, serverInfo, jobItem) { function createLocalItem(libraryItem, serverInfo, jobItem) {
@ -211,14 +316,19 @@
var path = getDirectoryPath(libraryItem, serverInfo); var path = getDirectoryPath(libraryItem, serverInfo);
var localFolder = filerepository.getFullLocalPath(path); var localFolder = filerepository.getFullLocalPath(path);
path.push(getLocalFileName(libraryItem, jobItem.OriginalFileName)); var localPath;
var localPath = filerepository.getFullLocalPath(path); if (jobItem) {
path.push(getLocalFileName(libraryItem, jobItem.OriginalFileName));
localPath = filerepository.getFullLocalPath(path);
}
for (var i = 0; i < libraryItem.MediaSources.length; i++) { if (libraryItem.MediaSources) {
var mediaSource = libraryItem.MediaSources[i]; for (var i = 0; i < libraryItem.MediaSources.length; i++) {
mediaSource.Path = localPath; var mediaSource = libraryItem.MediaSources[i];
mediaSource.Protocol = 'File'; mediaSource.Path = localPath;
mediaSource.Protocol = 'File';
}
} }
var item = { var item = {
@ -228,11 +338,14 @@
ServerId: serverInfo.Id, ServerId: serverInfo.Id,
LocalPath: localPath, LocalPath: localPath,
LocalFolder: localFolder, LocalFolder: localFolder,
AdditionalFiles: jobItem.AdditionalFiles.slice(0), Id: getLocalId(serverInfo.Id, libraryItem.Id)
Id: getLocalId(serverInfo.Id, libraryItem.Id),
SyncJobItemId: jobItem.SyncJobItemId
}; };
if (jobItem) {
item.AdditionalFiles = jobItem.AdditionalFiles.slice(0);
item.SyncJobItemId = jobItem.SyncJobItemId;
}
return Promise.resolve(item); return Promise.resolve(item);
} }
@ -276,12 +389,14 @@
function downloadFile(url, localItem) { function downloadFile(url, localItem) {
return transfermanager.downloadFile(url, localItem); var folder = filerepository.getLocalPath();
return transfermanager.downloadFile(url, folder, localItem);
} }
function downloadSubtitles(url, fileName) { function downloadSubtitles(url, fileName) {
return transfermanager.downloadSubtitles(url, fileName); var folder = filerepository.getLocalPath();
return transfermanager.downloadSubtitles(url, folder, fileName);
} }
function getImageUrl(serverId, itemId, imageType, index) { function getImageUrl(serverId, itemId, imageType, index) {
@ -296,7 +411,7 @@
function hasImage(serverId, itemId, imageType, index) { function hasImage(serverId, itemId, imageType, index) {
var pathArray = getImagePath(serverId, itemId, imageType, index); var pathArray = getImagePath(serverId, itemId, imageType, index);
var localFilePath = filerepository.getFullLocalPath(pathArray); var localFilePath = filerepository.getFullMetadataPath(pathArray);
return filerepository.fileExists(localFilePath).then(function (exists) { return filerepository.fileExists(localFilePath).then(function (exists) {
// TODO: Maybe check for broken download when file size is 0 and item is not queued // TODO: Maybe check for broken download when file size is 0 and item is not queued
@ -316,7 +431,7 @@
function downloadImage(localItem, url, serverId, itemId, imageType, index) { function downloadImage(localItem, url, serverId, itemId, imageType, index) {
var pathArray = getImagePath(serverId, itemId, imageType, index); var pathArray = getImagePath(serverId, itemId, imageType, index);
var localFilePath = filerepository.getFullLocalPath(pathArray); var localFilePath = filerepository.getFullMetadataPath(pathArray);
if (!localItem.AdditionalFiles) { if (!localItem.AdditionalFiles) {
localItem.AdditionalFiles = []; localItem.AdditionalFiles = [];
@ -331,7 +446,8 @@
localItem.AdditionalFiles.push(fileInfo); localItem.AdditionalFiles.push(fileInfo);
return transfermanager.downloadImage(url, localFilePath); var folder = filerepository.getMetadataPath();
return transfermanager.downloadImage(url, folder, localFilePath);
} }
function isDownloadFileInQueue(path) { function isDownloadFileInQueue(path) {
@ -339,6 +455,11 @@
return transfermanager.isDownloadFileInQueue(path); return transfermanager.isDownloadFileInQueue(path);
} }
function getDownloadItemCount() {
return transfermanager.getDownloadItemCount();
}
function translateFilePath(path) { function translateFilePath(path) {
return Promise.resolve(path); return Promise.resolve(path);
} }
@ -409,7 +530,9 @@
parts.push('Metadata'); parts.push('Metadata');
parts.push(serverId); parts.push(serverId);
parts.push('images'); parts.push('images');
parts.push(itemId + '_' + imageType + '_' + index.toString() + '.png'); // Store without extension. This allows mixed image types since the browser will
// detect the type from the content
parts.push(itemId + '_' + imageType + '_' + index.toString()); // + '.jpg');
var finalParts = []; var finalParts = [];
for (var i = 0; i < parts.length; i++) { for (var i = 0; i < parts.length; i++) {
@ -444,6 +567,29 @@
return uuid; return uuid;
} }
function startsWith(str, find) {
if (str && find && str.length > find.length) {
if (str.indexOf(find) === 0) {
return true;
}
}
return false;
}
function stripStart(str, find) {
if (startsWith(str, find)) {
return str.substr(find.length);
}
return str;
}
function filterDistinct(value, index, self) {
return self.indexOf(value) === index;
}
return { return {
getLocalItem: getLocalItem, getLocalItem: getLocalItem,
@ -468,8 +614,10 @@
getServerItems: getServerItems, getServerItems: getServerItems,
getItemFileSize: getItemFileSize, getItemFileSize: getItemFileSize,
isDownloadFileInQueue: isDownloadFileInQueue, isDownloadFileInQueue: isDownloadFileInQueue,
getDownloadItemCount: getDownloadItemCount,
getViews: getViews, getViews: getViews,
getViewItems: getViewItems, getViewItems: getViewItems,
resyncTransfers: resyncTransfers resyncTransfers: resyncTransfers,
getItemsFromIds: getItemsFromIds
}; };
}); });

View File

@ -90,7 +90,7 @@
function clear() { function clear() {
return dbPromise.then(function (db) { return dbPromise.then(function (db) {
var tx = db.transaction(dbName, 'readwrite'); var tx = db.transaction(dbName, 'readwrite');
tx.objectStore(dbName).clear(key); tx.objectStore(dbName).clear();
return tx.complete; return tx.complete;
}); });
} }

View File

@ -178,7 +178,7 @@
}); });
} }
function getNewMedia(apiClient, serverInfo, options) { function getNewMedia(apiClient, serverInfo, options, downloadCount) {
console.log('[mediasync] Begin getNewMedia'); console.log('[mediasync] Begin getNewMedia');
@ -186,10 +186,15 @@
var p = Promise.resolve(); var p = Promise.resolve();
var maxDownloads = 10;
var currentCount = downloadCount;
jobItems.forEach(function (jobItem) { jobItems.forEach(function (jobItem) {
p = p.then(function () { if (currentCount++ <= maxDownloads) {
return getNewItem(jobItem, apiClient, serverInfo, options); p = p.then(function () {
}); return getNewItem(jobItem, apiClient, serverInfo, options);
});
}
}); });
return p.then(function () { return p.then(function () {
@ -216,7 +221,9 @@
libraryItem.CanDelete = false; libraryItem.CanDelete = false;
libraryItem.CanDownload = false; libraryItem.CanDownload = false;
libraryItem.SupportsSync = false;
libraryItem.People = []; libraryItem.People = [];
libraryItem.UserData = [];
libraryItem.SpecialFeatureCount = null; libraryItem.SpecialFeatureCount = null;
return localassetmanager.createLocalItem(libraryItem, serverInfo, jobItem).then(function (localItem) { return localassetmanager.createLocalItem(libraryItem, serverInfo, jobItem).then(function (localItem) {
@ -225,18 +232,94 @@
localItem.SyncStatus = 'queued'; localItem.SyncStatus = 'queued';
return downloadMedia(apiClient, jobItem, localItem, options).then(function () { return downloadParentItems(apiClient, jobItem, localItem, serverInfo, options).then(function () {
return getImages(apiClient, jobItem, localItem).then(function () { return downloadMedia(apiClient, jobItem, localItem, options).then(function () {
return getSubtitles(apiClient, jobItem, localItem); return getImages(apiClient, jobItem, localItem).then(function () {
return getSubtitles(apiClient, jobItem, localItem);
});
}); });
}); });
}); });
}); });
} }
function downloadParentItems(apiClient, jobItem, localItem, serverInfo, options) {
var p = Promise.resolve();
var libraryItem = localItem.Item;
var itemType = (libraryItem.Type || '').toLowerCase();
var logoImageTag = (libraryItem.ImageTags || {}).Logo;
switch (itemType) {
case 'episode':
if (libraryItem.SeriesId && libraryItem.SeriesId) {
p = p.then(function () {
return downloadItem(apiClient, libraryItem, libraryItem.SeriesId, serverInfo).then(function (seriesItem) {
libraryItem.SeriesLogoImageTag = (seriesItem.Item.ImageTags || {}).Logo;
return Promise.resolve();
});
});
}
if (libraryItem.SeasonId && libraryItem.SeasonId) {
p = p.then(function () {
return downloadItem(apiClient, libraryItem, libraryItem.SeasonId, serverInfo).then(function (seasonItem) {
libraryItem.SeasonPrimaryImageTag = (seasonItem.Item.ImageTags || {}).Primary;
return Promise.resolve();
});
});
}
break;
case 'audio':
case 'photo':
if (libraryItem.AlbumId && libraryItem.AlbumId) {
p = p.then(function () {
return downloadItem(apiClient, libraryItem, libraryItem.AlbumId, serverInfo);
});
}
break;
case 'video':
case 'movie':
case 'musicvideo':
// no parent item download for now
break;
}
return p;
}
function downloadItem(apiClient, libraryItem, itemId, serverInfo) {
return apiClient.getItem(apiClient.getCurrentUserId(), itemId).then(function (downloadedItem) {
downloadedItem.CanDelete = false;
downloadedItem.CanDownload = false;
downloadedItem.SupportsSync = false;
downloadedItem.People = [];
downloadedItem.UserData = {};
downloadedItem.SpecialFeatureCount = null;
downloadedItem.BackdropImageTags = null;
return localassetmanager.createLocalItem(downloadedItem, serverInfo, null).then(function (localItem) {
return localassetmanager.addOrUpdateLocalItem(localItem).then(function () {
return Promise.resolve(localItem);
});
});
}, function (err) {
console.error('[mediasync] downloadItem failed: ' + err.toString());
return Promise.resolve(null);
});
}
function downloadMedia(apiClient, jobItem, localItem, options) { function downloadMedia(apiClient, jobItem, localItem, options) {
var url = apiClient.getUrl('Sync/JobItems/' + jobItem.SyncJobItemId + '/File', { var url = apiClient.getUrl('Sync/JobItems/' + jobItem.SyncJobItemId + '/File', {
@ -327,8 +410,23 @@
p = p.then(function () { p = p.then(function () {
return downloadImage(localItem, apiClient, serverId, libraryItem.SeriesId, libraryItem.SeriesPrimaryImageTag, 'Primary'); return downloadImage(localItem, apiClient, serverId, libraryItem.SeriesId, libraryItem.SeriesPrimaryImageTag, 'Primary');
}); });
}
if (libraryItem.SeriesId && libraryItem.SeriesThumbImageTag) {
p = p.then(function () { p = p.then(function () {
return downloadImage(localItem, apiClient, serverId, libraryItem.SeriesId, libraryItem.SeriesPrimaryImageTag, 'Thumb'); return downloadImage(localItem, apiClient, serverId, libraryItem.SeriesId, libraryItem.SeriesThumbImageTag, 'Thumb');
});
}
if (libraryItem.SeriesId && libraryItem.SeriesLogoImageTag) {
p = p.then(function () {
return downloadImage(localItem, apiClient, serverId, libraryItem.SeriesId, libraryItem.SeriesLogoImageTag, 'Logo');
});
}
if (libraryItem.SeasonId && libraryItem.SeasonPrimaryImageTag) {
p = p.then(function () {
return downloadImage(localItem, apiClient, serverId, libraryItem.SeasonId, libraryItem.SeasonPrimaryImageTag, 'Primary');
}); });
} }
@ -344,6 +442,7 @@
return localassetmanager.addOrUpdateLocalItem(localItem); return localassetmanager.addOrUpdateLocalItem(localItem);
}, function (err) { }, function (err) {
console.log('[mediasync] Error getImages: ' + err.toString()); console.log('[mediasync] Error getImages: ' + err.toString());
return Promise.resolve();
}); });
} }
@ -359,18 +458,30 @@
return Promise.resolve(); return Promise.resolve();
} }
var imageUrl = apiClient.getImageUrl(itemId, { var maxWidth = 400;
if (imageType === 'backdrop') {
maxWidth = null;
}
var imageUrl = apiClient.getScaledImageUrl(itemId, {
tag: imageTag, tag: imageTag,
type: imageType, type: imageType,
format: 'png', maxWidth: maxWidth,
api_key: apiClient.accessToken() api_key: apiClient.accessToken()
}); });
console.log('[mediasync] downloadImage ' + itemId + ' ' + imageType + '_' + index.toString()); console.log('[mediasync] downloadImage ' + itemId + ' ' + imageType + '_' + index.toString());
return localassetmanager.downloadImage(localItem, imageUrl, serverId, itemId, imageType, index); return localassetmanager.downloadImage(localItem, imageUrl, serverId, itemId, imageType, index).then(function (result) {
return Promise.resolve();
}, function (err) {
console.log('[mediasync] Error downloadImage: ' + err.toString());
return Promise.resolve();
});
}, function (err) { }, function (err) {
console.log('[mediasync] Error downloadImage: ' + err.toString()); console.log('[mediasync] Error downloadImage: ' + err.toString());
return Promise.resolve();
}); });
} }
@ -450,26 +561,28 @@
return processDownloadStatus(apiClient, serverInfo, options).then(function () { return processDownloadStatus(apiClient, serverInfo, options).then(function () {
if (options.syncCheckProgressOnly === true) { return localassetmanager.getDownloadItemCount().then(function (downloadCount) {
return Promise.resolve();
}
return reportOfflineActions(apiClient, serverInfo).then(function () { if (options.syncCheckProgressOnly === true && downloadCount > 2) {
return Promise.resolve();
}
//// Do the first data sync return reportOfflineActions(apiClient, serverInfo).then(function () {
//return syncData(apiClient, serverInfo, false).then(function () {
// Download new content // Download new content
return getNewMedia(apiClient, serverInfo, options).then(function () { return getNewMedia(apiClient, serverInfo, options, downloadCount).then(function () {
// Do the second data sync // Do the second data sync
return syncData(apiClient, serverInfo, false).then(function () { return syncData(apiClient, serverInfo, false).then(function () {
console.log('[mediasync]************************************* Exit sync'); console.log('[mediasync]************************************* Exit sync');
return Promise.resolve(); return Promise.resolve();
});
}); });
//});
}); });
//});
}); });
}, function (err) {
console.error(err.toString());
}); });
}; };
}; };

View File

@ -1,17 +1,17 @@
define(['filerepository'], function (filerepository) { define(['filerepository'], function (filerepository) {
'use strict'; 'use strict';
function downloadFile(url, localPath) { function downloadFile(url, folderName, localPath) {
return Promise.resolve(); return Promise.resolve();
} }
function downloadSubtitles(url, localItem, subtitleStreamh) { function downloadSubtitles(url, folderName, localItem) {
return Promise.resolve(''); return Promise.resolve('');
} }
function downloadImage(url, serverId, itemId, imageTag) { function downloadImage(url, folderName, serverId, itemId, imageTag) {
return Promise.resolve(false); return Promise.resolve(false);
} }

View File

@ -14,12 +14,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.406", "version": "1.4.490",
"_release": "1.4.406", "_release": "1.4.490",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.406", "tag": "1.4.490",
"commit": "5ef7b315244a1804f2892269a42db94a52a86ea8" "commit": "d0ee6da0b7661ff97d3501ea7633d113d3cb5a99"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View File

@ -1,22 +1,339 @@
The MIT License GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (c) Emby https://emby.media Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy Preamble
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The licenses for most software are designed to take away your
all copies or substantial portions of the Software. freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR When we speak of free software, we are referring to freedom, not
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, price. Our General Public Licenses are designed to make sure that you
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE have the freedom to distribute copies of free software (and charge for
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER this service if you wish), that you receive source code or can get it
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, if you want it, that you can change the software or use pieces of it
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN in new free programs; and that you know you can do these things.
THE SOFTWARE.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{{description}}
Copyright (C) {{year}} {{fullname}}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -97,7 +97,7 @@
} }
.actionSheetTitle { .actionSheetTitle {
margin: .5em 0 1em !important; margin: .5em 0 !important;
padding: 0 1em; padding: 0 1em;
flex-grow: 0; flex-grow: 0;
} }

View File

@ -47,7 +47,8 @@ define(['appStorage', 'events'], function (appStorage, events) {
self.set('maxStaticMusicBitrate', val); self.set('maxStaticMusicBitrate', val);
} }
return parseInt(self.get('maxStaticMusicBitrate') || '0') || null; var defaultValue = 384000;
return parseInt(self.get('maxStaticMusicBitrate') || defaultValue.toString()) || defaultValue;
}; };
self.maxChromecastBitrate = function (val) { self.maxChromecastBitrate = function (val) {

View File

@ -201,7 +201,7 @@
return item.BackdropImageTags.map(function (imgTag, index) { return item.BackdropImageTags.map(function (imgTag, index) {
return apiClient.getScaledImageUrl(item.Id, Object.assign(imageOptions, { return apiClient.getScaledImageUrl(item.BackdropItemId || item.Id, Object.assign(imageOptions, {
type: "Backdrop", type: "Backdrop",
tag: imgTag, tag: imgTag,
maxWidth: getBackdropMaxWidth(), maxWidth: getBackdropMaxWidth(),
@ -294,14 +294,14 @@
currentRotationIndex = -1; currentRotationIndex = -1;
if (images.length > 1 && enableImageRotation !== false && enableRotation()) { if (images.length > 1 && enableImageRotation !== false && enableRotation()) {
rotationInterval = setInterval(onRotationInterval, 20000); rotationInterval = setInterval(onRotationInterval, 24000);
} }
onRotationInterval(); onRotationInterval();
} }
function onRotationInterval() { function onRotationInterval() {
if (playbackManager.isPlayingVideo()) { if (playbackManager.isPlayingLocally(['Video'])) {
return; return;
} }

View File

@ -248,16 +248,25 @@
browser.tv = true; browser.tv = true;
} }
if (userAgent.toLowerCase().indexOf("embytheaterpi") !== -1) {
browser.slow = true;
browser.noAnimation = true;
}
if (isMobile(userAgent)) { if (isMobile(userAgent)) {
browser.mobile = true; browser.mobile = true;
} }
browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') !== -1; browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') !== -1;
browser.animate = typeof document !== 'undefined' && document.documentElement.animate != null; browser.animate = typeof document !== 'undefined' && document.documentElement.animate != null;
browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || userAgent.toLowerCase().indexOf('smarthub') !== -1; browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || self.tizen != null;
browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) !== -1; browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) !== -1;
browser.edgeUwp = browser.edge && userAgent.toLowerCase().indexOf('msapphost') !== -1; browser.edgeUwp = browser.edge && userAgent.toLowerCase().indexOf('msapphost') !== -1;
if (!browser.tizen) {
browser.orsay = userAgent.toLowerCase().indexOf('smarthub') !== -1;
}
if (browser.edgeUwp) { if (browser.edgeUwp) {
browser.edge = true; browser.edge = true;
} }

View File

@ -370,6 +370,16 @@ define(['browser'], function (browser) {
profile.TranscodingProfiles = []; profile.TranscodingProfiles = [];
if (canPlayNativeHls() && options.enableHlsAudio) {
profile.TranscodingProfiles.push({
Container: 'ts',
Type: 'Audio',
AudioCodec: 'aac',
Context: 'Streaming',
Protocol: 'hls'
});
}
['opus', 'mp3', 'aac', 'wav'].filter(canPlayAudioFormat).forEach(function (audioFormat) { ['opus', 'mp3', 'aac', 'wav'].filter(canPlayAudioFormat).forEach(function (audioFormat) {
profile.TranscodingProfiles.push({ profile.TranscodingProfiles.push({
@ -390,13 +400,8 @@ define(['browser'], function (browser) {
}); });
}); });
var copyTimestamps = false;
if (browser.chrome) {
copyTimestamps = true;
}
// Can't use mkv on mobile because we have to use the native player controls and they won't be able to seek it // Can't use mkv on mobile because we have to use the native player controls and they won't be able to seek it
if (canPlayMkv && options.supportsCustomSeeking && !browser.tizen && options.enableMkvProgressive !== false) { if (canPlayMkv && !browser.tizen && options.enableMkvProgressive !== false) {
profile.TranscodingProfiles.push({ profile.TranscodingProfiles.push({
Container: 'mkv', Container: 'mkv',
Type: 'Video', Type: 'Video',
@ -404,7 +409,7 @@ define(['browser'], function (browser) {
VideoCodec: 'h264', VideoCodec: 'h264',
Context: 'Streaming', Context: 'Streaming',
MaxAudioChannels: physicalAudioChannels.toString(), MaxAudioChannels: physicalAudioChannels.toString(),
CopyTimestamps: copyTimestamps CopyTimestamps: true
}); });
} }
@ -435,7 +440,6 @@ define(['browser'], function (browser) {
} }
if (canPlayWebm) { if (canPlayWebm) {
profile.TranscodingProfiles.push({ profile.TranscodingProfiles.push({
Container: 'webm', Container: 'webm',
Type: 'Video', Type: 'Video',
@ -557,6 +561,16 @@ define(['browser'], function (browser) {
} }
var isTizenFhd = false; var isTizenFhd = false;
if (browser.tizen) {
try {
var isTizenUhd = webapis.productinfo.isUdPanelSupported();
isTizenFhd = !isTizenUhd;
console.log("isTizenFhd = " + isTizenFhd);
} catch (error) {
console.log("isUdPanelSupported() error code = " + error.code);
}
}
var globalMaxVideoBitrate = browser.ps4 ? '8000000' : var globalMaxVideoBitrate = browser.ps4 ? '8000000' :
(browser.xboxOne ? '10000000' : (browser.xboxOne ? '10000000' :
(browser.edgeUwp ? '40000000' : (browser.edgeUwp ? '40000000' :

View File

@ -6,15 +6,13 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
function getCardsHtml(items, options) { function getCardsHtml(items, options) {
var apiClient = connectionManager.currentApiClient();
if (arguments.length === 1) { if (arguments.length === 1) {
options = arguments[0]; options = arguments[0];
items = options.items; items = options.items;
} }
var html = buildCardsHtmlInternal(items, apiClient, options); var html = buildCardsHtmlInternal(items, options);
return html; return html;
} }
@ -249,12 +247,15 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
else if (options.shape === 'square') { else if (options.shape === 'square') {
options.width = options.width || 243; options.width = options.width || 243;
} }
else if (options.shape === 'banner') {
options.width = options.width || 800;
}
} }
options.width = options.width || getImageWidth(options.shape); options.width = options.width || getImageWidth(options.shape);
} }
function buildCardsHtmlInternal(items, apiClient, options) { function buildCardsHtmlInternal(items, options) {
var isVertical; var isVertical;
@ -269,7 +270,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
setCardData(items, options); setCardData(items, options);
if (options.indexBy === 'Genres') { if (options.indexBy === 'Genres') {
return buildCardsByGenreHtmlInternal(items, apiClient, options); return buildCardsByGenreHtmlInternal(items, options);
} }
var className = 'card'; var className = 'card';
@ -290,10 +291,18 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
var hasOpenSection; var hasOpenSection;
var sectionTitleTagName = options.sectionTitleTagName || 'div'; var sectionTitleTagName = options.sectionTitleTagName || 'div';
var apiClient;
var lastServerId;
for (var i = 0, length = items.length; i < length; i++) { for (var i = 0, length = items.length; i < length; i++) {
var item = items[i]; var item = items[i];
var serverId = item.ServerId || options.serverId;
if (serverId !== lastServerId) {
lastServerId = serverId;
apiClient = connectionManager.getApiClient(lastServerId);
}
if (options.indexBy) { if (options.indexBy) {
var newIndexValue = ''; var newIndexValue = '';
@ -404,7 +413,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
}); });
} }
function buildCardsByGenreHtmlInternal(items, apiClient, options) { function buildCardsByGenreHtmlInternal(items, options) {
var className = 'card'; var className = 'card';
@ -435,7 +444,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
} }
var cardClass = className; var cardClass = className;
currentItemHtml += buildCard(i, renderItem, apiClient, options, cardClass); currentItemHtml += buildCard(i, renderItem, connectionManager.getApiClient(renderItem.ServerId || options.serverId), options, cardClass);
itemsInRow++; itemsInRow++;
@ -498,6 +507,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
if (shape.indexOf('square') !== -1) { if (shape.indexOf('square') !== -1) {
return 1; return 1;
} }
if (shape.indexOf('banner') !== -1) {
return (1000 / 185);
}
} }
return null; return null;
} }
@ -583,7 +595,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
height = width && primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null; height = width && primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null;
imgUrl = apiClient.getScaledImageUrl(item.Id || item.ItemId, { imgUrl = apiClient.getScaledImageUrl(item.PrimaryImageItemId || item.Id || item.ItemId, {
type: "Primary", type: "Primary",
maxHeight: height, maxHeight: height,
maxWidth: width, maxWidth: width,
@ -1412,9 +1424,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
} }
} }
var apiClient = connectionManager.currentApiClient(); var html = buildCardsHtmlInternal(items, options);
var html = buildCardsHtmlInternal(items, apiClient, options);
if (html) { if (html) {

View File

@ -10,6 +10,10 @@
return false; return false;
} }
if (browser.noAnimation) {
return false;
}
return browser.supportsCssAnimation(); return browser.supportsCssAnimation();
} }

View File

@ -54,8 +54,8 @@
.emby-button > i { .emby-button > i {
/* For non-fab buttons that have icons */ /* For non-fab buttons that have icons */
font-size: 1.36em; font-size: 1.36em;
width: auto; width: 1em;
height: auto; height: 1em;
} }
.fab { .fab {
@ -72,8 +72,8 @@
} }
.fab > i { .fab > i {
height: auto; height: 1em;
width: auto; width: 1em;
vertical-align: middle; vertical-align: middle;
font-size: 2.85em; font-size: 2.85em;
} }
@ -88,8 +88,8 @@
} }
.fab.mini > i { .fab.mini > i {
height: auto; height: 1em;
width: auto; width: 1em;
font-size: 1.72em; font-size: 1.72em;
} }

View File

@ -127,3 +127,13 @@
opacity: .7; opacity: .7;
margin-bottom: 0; margin-bottom: 0;
} }
@-webkit-keyframes repaintChrome {
from {
padding: 0;
}
to {
padding: 0;
}
}

View File

@ -1,4 +1,4 @@
define(['css!./emby-checkbox', 'registerElement'], function () { define(['browser', 'dom', 'css!./emby-checkbox', 'registerElement'], function (browser, dom) {
'use strict'; 'use strict';
var EmbyCheckboxPrototype = Object.create(HTMLInputElement.prototype); var EmbyCheckboxPrototype = Object.create(HTMLInputElement.prototype);
@ -19,6 +19,22 @@
} }
} }
var enableRefreshHack = browser.tizen || browser.orsay || browser.operaTv || browser.web0s ? true : false;
function forceRefresh(loading) {
var elem = this.parentNode;
elem.style.webkitAnimationName = 'repaintChrome';
elem.style.webkitAnimationDelay = (loading === true ? '500ms' : '');
elem.style.webkitAnimationDuration = '10ms';
elem.style.webkitAnimationIterationCount = '1';
setTimeout(function () {
elem.style.webkitAnimationName = '';
}, (loading === true ? 520 : 20));
}
EmbyCheckboxPrototype.attachedCallback = function () { EmbyCheckboxPrototype.attachedCallback = function () {
if (this.getAttribute('data-embycheckbox') === 'true') { if (this.getAttribute('data-embycheckbox') === 'true') {
@ -47,10 +63,27 @@
labelTextElement.classList.add('checkboxLabel'); labelTextElement.classList.add('checkboxLabel');
this.addEventListener('keydown', onKeyDown); this.addEventListener('keydown', onKeyDown);
if (enableRefreshHack) {
forceRefresh.call(this, true);
dom.addEventListener(this, 'click', forceRefresh, {
passive: true
});
dom.addEventListener(this, 'blur', forceRefresh, {
passive: true
});
dom.addEventListener(this, 'focus', forceRefresh, {
passive: true
});
dom.addEventListener(this, 'change', forceRefresh, {
passive: true
});
}
}; };
document.registerElement('emby-checkbox', { document.registerElement('emby-checkbox', {
prototype: EmbyCheckboxPrototype, prototype: EmbyCheckboxPrototype,
extends: 'input' extends: 'input'
}); });
}); });

View File

@ -107,20 +107,35 @@
function onDrop(evt, itemsContainer) { function onDrop(evt, itemsContainer) {
loading.show();
var el = evt.item; var el = evt.item;
var newIndex = evt.newIndex; var newIndex = evt.newIndex;
var itemId = el.getAttribute('data-playlistitemid'); var itemId = el.getAttribute('data-playlistitemid');
var playlistId = el.getAttribute('data-playlistid'); var playlistId = el.getAttribute('data-playlistid');
if (!playlistId) {
var oldIndex = evt.oldIndex;
el.dispatchEvent(new CustomEvent('itemdrop', {
detail: {
oldIndex: oldIndex,
newIndex: newIndex,
playlistItemId: itemId
},
bubbles: true,
cancelable: false
}));
return;
}
var serverId = el.getAttribute('data-serverid'); var serverId = el.getAttribute('data-serverid');
var apiClient = connectionManager.getApiClient(serverId); var apiClient = connectionManager.getApiClient(serverId);
newIndex = Math.max(0, newIndex - 1); newIndex = Math.max(0, newIndex - 1);
loading.show();
apiClient.ajax({ apiClient.ajax({
url: apiClient.getUrl('Playlists/' + playlistId + '/Items/' + itemId + '/Move/' + newIndex), url: apiClient.getUrl('Playlists/' + playlistId + '/Items/' + itemId + '/Move/' + newIndex),
@ -129,7 +144,6 @@
}).then(function () { }).then(function () {
el.setAttribute('data-index', newIndex);
loading.hide(); loading.hide();
}, function () { }, function () {
@ -171,7 +185,7 @@
// dragging ended // dragging ended
onEnd: function (/**Event*/evt) { onEnd: function (/**Event*/evt) {
onDrop(evt, self); return onDrop(evt, self);
} }
}); });
}); });
@ -237,6 +251,11 @@
} }
} }
ItemsContainerProtoType.createdCallback = function () {
this.classList.add('itemsContainer');
};
ItemsContainerProtoType.attachedCallback = function () { ItemsContainerProtoType.attachedCallback = function () {
this.addEventListener('click', onClick); this.addEventListener('click', onClick);
@ -264,6 +283,10 @@
addNotificationEvent(this, 'SeriesTimerCreated', onSeriesTimerCreated); addNotificationEvent(this, 'SeriesTimerCreated', onSeriesTimerCreated);
addNotificationEvent(this, 'TimerCancelled', onTimerCancelled); addNotificationEvent(this, 'TimerCancelled', onTimerCancelled);
addNotificationEvent(this, 'SeriesTimerCancelled', onSeriesTimerCancelled); addNotificationEvent(this, 'SeriesTimerCancelled', onSeriesTimerCancelled);
if (this.getAttribute('data-dragreorder') === 'true') {
this.enableDragReordering(true);
}
}; };
ItemsContainerProtoType.detachedCallback = function () { ItemsContainerProtoType.detachedCallback = function () {

View File

@ -16,7 +16,7 @@ _:-ms-input-placeholder, :root .mdl-slider {
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
outline: 0; outline: 0;
padding: 1.5em 0; padding: 1em 0;
color: #52B54B; color: #52B54B;
-webkit-align-self: center; -webkit-align-self: center;
-ms-flex-item-align: center; -ms-flex-item-align: center;
@ -220,9 +220,9 @@ _:-ms-input-placeholder, :root .mdl-slider {
.sliderBubble { .sliderBubble {
position: absolute; position: absolute;
top: -3.7em; top: 0;
left: 0; left: 0;
padding: .5em 1em; transform: translate3d(-48%, -120%, 0);
background: #282828; background: #282828;
color: #fff; color: #fff;
display: flex; display: flex;
@ -232,4 +232,5 @@ _:-ms-input-placeholder, :root .mdl-slider {
.sliderBubbleText { .sliderBubbleText {
margin: 0; margin: 0;
padding: .5em .75em;
} }

View File

@ -38,21 +38,29 @@
function updateBubble(range, value, bubble, bubbleText) { function updateBubble(range, value, bubble, bubbleText) {
bubble.style.left = (value - 1) + '%'; bubble.style.left = value + '%';
if (range.getBubbleText) { if (range.getBubbleHtml) {
value = range.getBubbleText(value); value = range.getBubbleHtml(value);
} else {
if (range.getBubbleText) {
value = range.getBubbleText(value);
} else {
value = Math.round(value);
}
value = '<h1 class="sliderBubbleText">' + value + '</h1>';
} }
bubbleText.innerHTML = value;
bubble.innerHTML = value;
} }
EmbySliderPrototype.attachedCallback = function () { EmbySliderPrototype.attachedCallback = function () {
if (this.getAttribute('data-embycheckbox') === 'true') { if (this.getAttribute('data-embyslider') === 'true') {
return; return;
} }
this.setAttribute('data-embycheckbox', 'true'); this.setAttribute('data-embyslider', 'true');
this.classList.add('mdl-slider'); this.classList.add('mdl-slider');
this.classList.add('mdl-js-slider'); this.classList.add('mdl-js-slider');
@ -70,21 +78,20 @@
htmlToInsert += '<div class="mdl-slider__background-flex"><div class="mdl-slider__background-lower"></div><div class="mdl-slider__background-upper"></div></div>'; htmlToInsert += '<div class="mdl-slider__background-flex"><div class="mdl-slider__background-lower"></div><div class="mdl-slider__background-upper"></div></div>';
} }
htmlToInsert += '<div class="sliderBubble hide"><h1 class="sliderBubbleText"></h1></div>'; htmlToInsert += '<div class="sliderBubble hide"></div>';
containerElement.insertAdjacentHTML('beforeend', htmlToInsert); containerElement.insertAdjacentHTML('beforeend', htmlToInsert);
var backgroundLower = containerElement.querySelector('.mdl-slider__background-lower'); var backgroundLower = containerElement.querySelector('.mdl-slider__background-lower');
var backgroundUpper = containerElement.querySelector('.mdl-slider__background-upper'); var backgroundUpper = containerElement.querySelector('.mdl-slider__background-upper');
var sliderBubble = containerElement.querySelector('.sliderBubble'); var sliderBubble = containerElement.querySelector('.sliderBubble');
var sliderBubbleText = containerElement.querySelector('.sliderBubbleText');
var hasHideClass = sliderBubble.classList.contains('hide'); var hasHideClass = sliderBubble.classList.contains('hide');
dom.addEventListener(this, 'input', function (e) { dom.addEventListener(this, 'input', function (e) {
this.dragging = true; this.dragging = true;
updateBubble(this, this.value, sliderBubble, sliderBubbleText); updateBubble(this, this.value, sliderBubble);
if (hasHideClass) { if (hasHideClass) {
sliderBubble.classList.remove('hide'); sliderBubble.classList.remove('hide');
@ -114,7 +121,7 @@
var clientX = e.clientX; var clientX = e.clientX;
var bubbleValue = (clientX - rect.left) / rect.width; var bubbleValue = (clientX - rect.left) / rect.width;
bubbleValue *= 100; bubbleValue *= 100;
updateBubble(this, Math.round(bubbleValue), sliderBubble, sliderBubbleText); updateBubble(this, bubbleValue, sliderBubble);
if (hasHideClass) { if (hasHideClass) {
sliderBubble.classList.remove('hide'); sliderBubble.classList.remove('hide');

View File

@ -2,7 +2,7 @@
font-family: 'Material Icons'; font-family: 'Material Icons';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url(2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2) format('woff2'), url(2fcrYFNaTjcS6g4U3t-Y5ewrjPiaoEww8AihgqWRJAo.woff) format('woff'); src: local('Material Icons'), local('MaterialIcons-Regular'), url(2fcryfnatjcs6g4u3t-y5zjzjt5fdej140u2djyc3my.woff2) format('woff2'), url(2fcryfnatjcs6g4u3t-y5ewrjpiaoeww8aihgqwrjao.woff) format('woff');
} }
.md-icon { .md-icon {

View File

@ -1,17 +0,0 @@
/* latin */
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: local('Montserrat-Regular'), url(zhcz-_WihjSQC0oHJ9TCYPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2'), url(zhcz-_WihjSQC0oHJ9TCYBsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* latin */
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 700;
src: local('Montserrat-Bold'), url(IQHow_FEYlDC4Gzy_m8fcoWiMMZ7xLd792ULpGE4W_Y.woff2) format('woff2'), url(IQHow_FEYlDC4Gzy_m8fcgFhaRv2pGgT5Kf0An0s4MM.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

View File

@ -1,280 +0,0 @@
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2) format('woff2'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 500;
src: local('Open Sans'), local('OpenSans'), url(K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 500;
src: local('Open Sans'), local('OpenSans'), url(RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0500-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 500;
src: local('Open Sans'), local('OpenSans'), url(LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 500;
src: local('Open Sans'), local('OpenSans'), url(xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 500;
src: local('Open Sans'), local('OpenSans'), url(59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 500;
src: local('Open Sans'), local('OpenSans'), url(u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 500;
src: local('Open Sans'), local('OpenSans'), url(cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSnhCUOGz7vYGh680lGh-uXM.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(k3k702ZOKiLJc3WVjuplzK-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(k3k702ZOKiLJc3WVjuplzJX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(k3k702ZOKiLJc3WVjuplzBWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(k3k702ZOKiLJc3WVjuplzKaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(k3k702ZOKiLJc3WVjuplzP8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(k3k702ZOKiLJc3WVjuplzD0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(k3k702ZOKiLJc3WVjuplzOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2'), url(https://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

View File

@ -3,7 +3,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 100; font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(ty9dfvLAziwdqQ2dHoyjphTbgVql8nDJpwnrE27mub0.woff2) format('woff2'), url(RobotoThin.woff) format('woff'); src: local('Roboto Thin'), local('Roboto-Thin'), url(ty9dfvlaziwdqq2dhoyjphtbgvql8ndjpwnre27mub0.woff2) format('woff2'), url(robotothin.woff) format('woff');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
} }
/* cyrillic */ /* cyrillic */
@ -11,7 +11,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 100; font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(frNV30OaYdlFRtH2VnZZdhTbgVql8nDJpwnrE27mub0.woff2) format('woff2'), url(RobotoThin.woff) format('woff'); src: local('Roboto Thin'), local('Roboto-Thin'), url(frnv30oaydlfrth2vnzzdhtbgvql8ndjpwnre27mub0.woff2) format('woff2'), url(robotothin.woff) format('woff');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
} }
/* greek-ext */ /* greek-ext */
@ -19,7 +19,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 100; font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(gwVJDERN2Amz39wrSoZ7FxTbgVql8nDJpwnrE27mub0.woff2) format('woff2'), url(RobotoThin.woff) format('woff'); src: local('Roboto Thin'), local('Roboto-Thin'), url(gwvjdern2amz39wrsoz7fxtbgvql8ndjpwnre27mub0.woff2) format('woff2'), url(robotothin.woff) format('woff');
unicode-range: U+1F00-1FFF; unicode-range: U+1F00-1FFF;
} }
/* greek */ /* greek */
@ -27,7 +27,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 100; font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(aZMswpodYeVhtRvuABJWvBTbgVql8nDJpwnrE27mub0.woff2) format('woff2'), url(RobotoThin.woff) format('woff'); src: local('Roboto Thin'), local('Roboto-Thin'), url(azmswpodyevhtrvuabjwvbtbgvql8ndjpwnre27mub0.woff2) format('woff2'), url(robotothin.woff) format('woff');
unicode-range: U+0370-03FF; unicode-range: U+0370-03FF;
} }
/* vietnamese */ /* vietnamese */
@ -35,7 +35,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 100; font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(VvXUGKZXbHtX_S_VCTLpGhTbgVql8nDJpwnrE27mub0.woff2) format('woff2'), url(RobotoThin.woff) format('woff'); src: local('Roboto Thin'), local('Roboto-Thin'), url(vvxugkzxbhtx_s_vctlpghtbgvql8ndjpwnre27mub0.woff2) format('woff2'), url(robotothin.woff) format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
} }
/* latin-ext */ /* latin-ext */
@ -43,7 +43,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 100; font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(e7MeVAyvogMqFwwl61PKhBTbgVql8nDJpwnrE27mub0.woff2) format('woff2'), url(RobotoThin.woff) format('woff'); src: local('Roboto Thin'), local('Roboto-Thin'), url(e7mevayvogmqfwwl61pkhbtbgvql8ndjpwnre27mub0.woff2) format('woff2'), url(robotothin.woff) format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
} }
/* latin */ /* latin */
@ -51,7 +51,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 100; font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(2tsd397wLxj96qwHyNIkxPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(RobotoThin.woff) format('woff'); src: local('Roboto Thin'), local('Roboto-Thin'), url(2tsd397wlxj96qwhynikxpeszw2xoq-xsnqo47m55da.woff2) format('woff2'), url(robotothin.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} }
/* cyrillic-ext */ /* cyrillic-ext */
@ -59,7 +59,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(0eC6fl06luXEYWpBSJvXCBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoLight.woff) format('woff'); src: local('Roboto Light'), local('Roboto-Light'), url(0ec6fl06luxeywpbsjvxcbjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotolight.woff) format('woff');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
} }
/* cyrillic */ /* cyrillic */
@ -67,7 +67,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(Fl4y0QdOxyyTHEGMXX8kcRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoLight.woff) format('woff'); src: local('Roboto Light'), local('Roboto-Light'), url(fl4y0qdoxyythegmxx8kcrjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotolight.woff) format('woff');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
} }
/* greek-ext */ /* greek-ext */
@ -75,7 +75,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(-L14Jk06m6pUHB-5mXQQnRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoLight.woff) format('woff'); src: local('Roboto Light'), local('Roboto-Light'), url(-l14jk06m6puhb-5mxqqnrjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotolight.woff) format('woff');
unicode-range: U+1F00-1FFF; unicode-range: U+1F00-1FFF;
} }
/* greek */ /* greek */
@ -83,7 +83,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(I3S1wsgSg9YCurV6PUkTORJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoLight.woff) format('woff'); src: local('Roboto Light'), local('Roboto-Light'), url(i3s1wsgsg9ycurv6puktorjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotolight.woff) format('woff');
unicode-range: U+0370-03FF; unicode-range: U+0370-03FF;
} }
/* vietnamese */ /* vietnamese */
@ -91,7 +91,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(NYDWBdD4gIq26G5XYbHsFBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoLight.woff) format('woff'); src: local('Roboto Light'), local('Roboto-Light'), url(nydwbdd4giq26g5xybhsfbjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotolight.woff) format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
} }
/* latin-ext */ /* latin-ext */
@ -99,7 +99,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(Pru33qjShpZSmG3z6VYwnRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoLight.woff) format('woff'); src: local('Roboto Light'), local('Roboto-Light'), url(pru33qjshpzsmg3z6vywnrjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotolight.woff) format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
} }
/* latin */ /* latin */
@ -107,7 +107,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(Hgo13k-tfSpn0qi1SFdUfVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(RobotoLight.woff) format('woff'); src: local('Roboto Light'), local('Roboto-Light'), url(hgo13k-tfspn0qi1sfdufvtxra8tvwticgirnjhmvjw.woff2) format('woff2'), url(robotolight.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} }
/* cyrillic-ext */ /* cyrillic-ext */
@ -115,7 +115,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(RobotoRegular.woff) format('woff'); src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(robotoregular.woff) format('woff');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
} }
/* cyrillic */ /* cyrillic */
@ -123,7 +123,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(RobotoRegular.woff) format('woff'); src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(robotoregular.woff) format('woff');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
} }
/* greek-ext */ /* greek-ext */
@ -131,7 +131,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/-2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(RobotoRegular.woff) format('woff'); src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/-2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(robotoregular.woff) format('woff');
unicode-range: U+1F00-1FFF; unicode-range: U+1F00-1FFF;
} }
/* greek */ /* greek */
@ -139,7 +139,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(RobotoRegular.woff) format('woff'); src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(robotoregular.woff) format('woff');
unicode-range: U+0370-03FF; unicode-range: U+0370-03FF;
} }
/* vietnamese */ /* vietnamese */
@ -147,7 +147,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(RobotoRegular.woff) format('woff'); src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(robotoregular.woff) format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
} }
/* latin-ext */ /* latin-ext */
@ -155,7 +155,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(Fcx7Wwv8OzT71A3E1XOAjvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'), url(RobotoRegular.woff) format('woff'); src: local('Roboto'), local('Roboto-Regular'), url(fcx7wwv8ozt71a3e1xoajveszw2xoq-xsnqo47m55da.woff2) format('woff2'), url(robotoregular.woff) format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
} }
/* latin */ /* latin */
@ -163,7 +163,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(CWB0XYA8bzo0kSThX0UTuA.woff2) format('woff2'), url(RobotoRegular.woff) format('woff'); src: local('Roboto'), local('Roboto-Regular'), url(cwb0xya8bzo0ksthx0utua.woff2) format('woff2'), url(robotoregular.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} }
/* cyrillic-ext */ /* cyrillic-ext */
@ -171,7 +171,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoMedium.woff) format('woff'); src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotomedium.woff) format('woff');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
} }
/* cyrillic */ /* cyrillic */
@ -179,7 +179,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoMedium.woff) format('woff'); src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotomedium.woff) format('woff');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
} }
/* greek-ext */ /* greek-ext */
@ -187,7 +187,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoMedium.woff) format('woff'); src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotomedium.woff) format('woff');
unicode-range: U+1F00-1FFF; unicode-range: U+1F00-1FFF;
} }
/* greek */ /* greek */
@ -195,7 +195,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoMedium.woff) format('woff'); src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotomedium.woff) format('woff');
unicode-range: U+0370-03FF; unicode-range: U+0370-03FF;
} }
/* vietnamese */ /* vietnamese */
@ -203,7 +203,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoMedium.woff) format('woff'); src: local('Roboto Medium'), local('Roboto-Medium'), url(https://fonts.gstatic.com/s/roboto/v15/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotomedium.woff) format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
} }
/* latin-ext */ /* latin-ext */
@ -211,7 +211,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(oOeFwZNlrTefzLYmlVV1UBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoMedium.woff) format('woff'); src: local('Roboto Medium'), local('Roboto-Medium'), url(ooefwznlrtefzlymlvv1ubjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotomedium.woff) format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
} }
/* latin */ /* latin */
@ -219,7 +219,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(RobotoMedium.woff) format('woff'); src: local('Roboto Medium'), local('Roboto-Medium'), url(rxzjdnzeo3r5zsexge8uuvtxra8tvwticgirnjhmvjw.woff2) format('woff2'), url(robotomedium.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} }
/* cyrillic-ext */ /* cyrillic-ext */
@ -227,7 +227,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/77FXFjRbGzN4aCrSFhlh3hJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoBold.woff) format('woff'); src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/77FXFjRbGzN4aCrSFhlh3hJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotobold.woff) format('woff');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
} }
/* cyrillic */ /* cyrillic */
@ -235,7 +235,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/isZ-wbCXNKAbnjo6_TwHThJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoBold.woff) format('woff'); src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/isZ-wbCXNKAbnjo6_TwHThJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotobold.woff) format('woff');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
} }
/* greek-ext */ /* greek-ext */
@ -243,7 +243,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/UX6i4JxQDm3fVTc1CPuwqhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoBold.woff) format('woff'); src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/UX6i4JxQDm3fVTc1CPuwqhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotobold.woff) format('woff');
unicode-range: U+1F00-1FFF; unicode-range: U+1F00-1FFF;
} }
/* greek */ /* greek */
@ -251,7 +251,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/jSN2CGVDbcVyCnfJfjSdfBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoBold.woff) format('woff'); src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/jSN2CGVDbcVyCnfJfjSdfBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotobold.woff) format('woff');
unicode-range: U+0370-03FF; unicode-range: U+0370-03FF;
} }
/* vietnamese */ /* vietnamese */
@ -259,7 +259,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/PwZc-YbIL414wB9rB1IAPRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoBold.woff) format('woff'); src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v15/PwZc-YbIL414wB9rB1IAPRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(robotobold.woff) format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
} }
/* latin-ext */ /* latin-ext */
@ -267,7 +267,7 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(97uahxiqZRoncBaCEI3aWxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'), url(RobotoBold.woff) format('woff'); src: local('Roboto Bold'), local('Roboto-Bold'), url(97uahxiqzroncbacei3awxjtnkitppoi_ivcxxdnrsc.woff2) format('woff2'), url(robotobold.woff) format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
} }
/* latin */ /* latin */
@ -275,6 +275,6 @@
font-family: 'Roboto'; font-family: 'Roboto';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(d-6IYplOFocCacKzxwXSOFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(RobotoBold.woff) format('woff'); src: local('Roboto Bold'), local('Roboto-Bold'), url(d-6iyplofoccackzxwxsoftxra8tvwticgirnjhmvjw.woff2) format('woff2'), url(robotobold.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} }

View File

@ -1,12 +1,23 @@
define(['dom', 'fullscreenManager'], function (dom, fullscreenManager) { define(['dom', 'fullscreenManager'], function (dom, fullscreenManager) {
'use strict'; 'use strict';
dom.addEventListener(window, 'dblclick', function () { function isTargetValid(target) {
if (fullscreenManager.isFullScreen()) { if (dom.parentWithTag(target, ['BUTTON', 'INPUT', 'TEXTAREA'])) {
fullscreenManager.exitFullscreen(); return false;
} else { }
fullscreenManager.requestFullscreen();
return true;
}
dom.addEventListener(window, 'dblclick', function (e) {
if (isTargetValid(e.target)) {
if (fullscreenManager.isFullScreen()) {
fullscreenManager.exitFullscreen();
} else {
fullscreenManager.requestFullscreen();
}
} }
}, { }, {

View File

@ -1,4 +1,4 @@
define([], function () { define(['events', 'dom'], function (events, dom) {
'use strict'; 'use strict';
function fullscreenManager() { function fullscreenManager() {
@ -38,5 +38,23 @@ define([], function () {
return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false; return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false;
}; };
return new fullscreenManager(); var manager = new fullscreenManager();
function onFullScreenChange() {
events.trigger(manager, 'fullscreenchange');
}
dom.addEventListener(document, 'fullscreenchange', onFullScreenChange, {
passive: true
});
dom.addEventListener(document, 'webkitfullscreenchange', onFullScreenChange, {
passive: true
});
dom.addEventListener(document, 'mozfullscreenchange', onFullScreenChange, {
passive: true
});
return manager;
}); });

View File

@ -66,6 +66,8 @@
white-space: nowrap; white-space: nowrap;
position: relative; position: relative;
contain: strict; contain: strict;
box-sizing: border-box;
border-bottom: .2em solid #121212;
} }
.timeslotHeadersInner { .timeslotHeadersInner {
@ -79,7 +81,7 @@
width: 100%; width: 100%;
height: 2px; height: 2px;
display: flex; display: flex;
margin-left: .65vh; margin-left: .25em;
background-color: #52B54B; background-color: #52B54B;
height: 2px; height: 2px;
transform-origin: left; transform-origin: left;
@ -88,10 +90,10 @@
.currentTimeIndicatorArrowContainer { .currentTimeIndicatorArrowContainer {
position: absolute; position: absolute;
bottom: -1vh; bottom: -.4em;
width: 100%; width: 100%;
color: #52B54B; color: #52B54B;
margin-left: .65vh; margin-left: .25em;
transform-origin: left; transform-origin: left;
transition: transform 500ms ease-out; transition: transform 500ms ease-out;
} }
@ -102,11 +104,11 @@
} }
.currentTimeIndicatorArrow { .currentTimeIndicatorArrow {
width: 3vh; width: 1em;
height: 3vh; height: 1em;
font-size: 3vh; font-size: 1.2em;
color: #52B54B; color: #52B54B;
margin-left: -1.5vh; margin-left: -.52em;
} }
.channelPrograms, .timeslotHeadersInner { .channelPrograms, .timeslotHeadersInner {
@ -144,8 +146,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
border-right: 1px solid #121212; border-right: 1px solid #121212;
width: 24vw; background: rgb(38, 38, 38);
background: rgba(40, 40, 40, .9);
display: flex; display: flex;
align-items: center; align-items: center;
text-decoration: none; text-decoration: none;
@ -154,30 +155,37 @@
contain: strict; contain: strict;
} }
@media all and (min-width: 500px) { /* Important - have to put the fixed width on channelsContainer, not the individual channelHeaderCell
This was causing channelsContainer to extend beyond the fixed width on ps4, tizen, lg and opera tv.
*/
.channelsContainer, .channelTimeslotHeader {
width: 24vw;
}
.channelHeaderCell, .channelTimeslotHeader { .channelHeaderCell {
width: 100%;
}
@media all and (min-width:500px) {
.channelsContainer, .channelTimeslotHeader {
width: 16vw; width: 16vw;
} }
} }
@media all and (min-width: 600px) { @media all and (min-width:600px) {
.channelsContainer, .channelTimeslotHeader {
.channelHeaderCell, .channelTimeslotHeader {
width: 16vw; width: 16vw;
} }
} }
@media all and (min-width: 800px) { @media all and (min-width:800px) {
.channelsContainer, .channelTimeslotHeader {
.channelHeaderCell, .channelTimeslotHeader {
width: 14vw; width: 14vw;
} }
} }
@media all and (min-width: 1280px) { @media all and (min-width:1280px) {
.channelsContainer, .channelTimeslotHeader {
.channelHeaderCell, .channelTimeslotHeader {
width: 12vw; width: 12vw;
} }
} }
@ -196,7 +204,7 @@
} }
.channelHeaderCell { .channelHeaderCell {
border-bottom: .65vh solid #121212 !important; border-bottom: .2em solid #121212 !important;
background-size: auto 70%; background-size: auto 70%;
background-position: 92% center; background-position: 92% center;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -209,15 +217,8 @@
} }
} }
@media all and (max-width: 1200px) {
.guideChannelNumberWithImage {
display: none;
}
}
.channelPrograms, .channelHeaderCell { .channelPrograms, .channelHeaderCell {
height: 4em; height: 4.4em;
contain: strict; contain: strict;
} }
@ -227,7 +228,7 @@
} }
.channelPrograms-tv, .channelHeaderCell-tv { .channelPrograms-tv, .channelHeaderCell-tv {
height: 3.2em; height: 3.4em;
} }
.channelTimeslotHeader { .channelTimeslotHeader {
@ -236,9 +237,6 @@
.channelTimeslotHeader, .timeslotHeader { .channelTimeslotHeader, .timeslotHeader {
background: transparent; background: transparent;
}
.timeslotHeader, .channelTimeslotHeader {
height: 2.2em; height: 2.2em;
} }
@ -254,10 +252,9 @@
.programCell { .programCell {
position: absolute; position: absolute;
top: 0; top: 0;
/* Unfortunately the borders using vh get rounded while the bottom property doesn't. So this is a little hack to try and make them even*/ bottom: 0;
bottom: .59vh; border-left: .2em solid #121212 !important;
border-left: .65vh solid #121212 !important; background-color: rgb(30, 30, 30);
background-color: rgba(32, 32, 32, .95);
display: flex; display: flex;
text-decoration: none; text-decoration: none;
overflow: hidden; overflow: hidden;
@ -265,6 +262,9 @@
/* Needed for Firefox */ /* Needed for Firefox */
text-align: left; text-align: left;
contain: strict; contain: strict;
flex-grow: 1;
margin: 0 !important;
padding: 0 !important;
} }
.programAccent { .programAccent {
@ -304,6 +304,20 @@
display: block; display: block;
} }
.guideProgramNameText {
margin: 0;
font-weight: normal;
}
.guideProgramSecondaryInfo {
display: flex;
align-items: center;
}
.programSecondaryTitle {
opacity: .6;
}
.programIcon { .programIcon {
margin-left: auto; margin-left: auto;
margin-right: .25em; margin-right: .25em;
@ -326,6 +340,8 @@
padding: .18em .32em; padding: .18em .32em;
border-radius: .25em; border-radius: .25em;
margin-right: .35em; margin-right: .35em;
width: auto;
height: auto;
} }
.programTextIcon-tv { .programTextIcon-tv {
@ -337,6 +353,8 @@
max-width: 30%; max-width: 30%;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
font-weight: normal;
margin: 0;
} }
.guideChannelName { .guideChannelName {
@ -364,14 +382,10 @@
.channelsContainer { .channelsContainer {
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;
}
.channelList {
display: flex;
flex-direction: column; flex-direction: column;
} }
.channelList, .programGrid { .channelsContainer, .programGrid {
contain: layout style; contain: layout style;
} }

View File

@ -512,20 +512,32 @@
html += '<div class="' + guideProgramNameClass + '">'; html += '<div class="' + guideProgramNameClass + '">';
html += '<div class="guideProgramNameText">' + program.Name + '</div>';
var indicatorHtml = null;
if (program.IsLive && options.showLiveIndicator) { if (program.IsLive && options.showLiveIndicator) {
html += '<span class="liveTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#Live') + '</span>'; indicatorHtml = '<span class="liveTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#Live') + '</span>';
} }
else if (program.IsPremiere && options.showPremiereIndicator) { else if (program.IsPremiere && options.showPremiereIndicator) {
html += '<span class="premiereTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#Premiere') + '</span>'; indicatorHtml = '<span class="premiereTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#Premiere') + '</span>';
} }
else if (program.IsSeries && !program.IsRepeat && options.showNewIndicator) { else if (program.IsSeries && !program.IsRepeat && options.showNewIndicator) {
html += '<span class="newTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#AttributeNew') + '</span>'; indicatorHtml = '<span class="newTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#AttributeNew') + '</span>';
} }
else if (program.IsSeries && program.IsRepeat && options.showRepeatIndicator) { else if (program.IsSeries && program.IsRepeat && options.showRepeatIndicator) {
html += '<span class="repeatTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#Repeat') + '</span>'; indicatorHtml = '<span class="repeatTvProgram guideProgramIndicator">' + globalize.translate('sharedcomponents#Repeat') + '</span>';
}
if (indicatorHtml || (program.EpisodeTitle && options.showEpisodeTitle)) {
html += '<div class="guideProgramSecondaryInfo">';
html += indicatorHtml || '';
if (program.EpisodeTitle && options.showEpisodeTitle) {
html += '<span class="programSecondaryTitle">' + program.EpisodeTitle + '</span>';
}
html += '</div>';
} }
html += program.Name;
html += '</div>'; html += '</div>';
if (program.IsHD && options.showHdIcon) { if (program.IsHD && options.showHdIcon) {
@ -566,7 +578,8 @@
showLiveIndicator: allowIndicators && userSettings.get('guide-indicator-live') !== 'false', showLiveIndicator: allowIndicators && userSettings.get('guide-indicator-live') !== 'false',
showPremiereIndicator: allowIndicators && userSettings.get('guide-indicator-premiere') !== 'false', showPremiereIndicator: allowIndicators && userSettings.get('guide-indicator-premiere') !== 'false',
showNewIndicator: allowIndicators && userSettings.get('guide-indicator-new') === 'true', showNewIndicator: allowIndicators && userSettings.get('guide-indicator-new') === 'true',
showRepeatIndicator: allowIndicators && userSettings.get('guide-indicator-repeat') === 'true' showRepeatIndicator: allowIndicators && userSettings.get('guide-indicator-repeat') === 'true',
showEpisodeTitle: layoutManager.tv ? false : true
}; };
for (var i = 0, length = channels.length; i < length; i++) { for (var i = 0, length = channels.length; i < length; i++) {
@ -610,20 +623,17 @@
html += '<button type="button" class="' + cssClass + '"' + dataSrc + ' data-action="link" data-isfolder="' + channel.IsFolder + '" data-id="' + channel.Id + '" data-serverid="' + channel.ServerId + '" data-type="' + channel.Type + '">'; html += '<button type="button" class="' + cssClass + '"' + dataSrc + ' data-action="link" data-isfolder="' + channel.IsFolder + '" data-id="' + channel.Id + '" data-serverid="' + channel.ServerId + '" data-type="' + channel.Type + '">';
cssClass = 'guideChannelNumber'; cssClass = 'guideChannelNumber';
if (hasChannelImage) {
cssClass += ' guideChannelNumberWithImage';
}
html += '<div class="' + cssClass + '">' + channel.Number + '</div>'; html += '<h3 class="' + cssClass + '">' + channel.Number + '</h3>';
if (!hasChannelImage) { if (!hasChannelImage && channel.Name) {
html += '<div class="guideChannelName">' + channel.Name + '</div>'; html += '<div class="guideChannelName">' + channel.Name + '</div>';
} }
html += '</button>'; html += '</button>';
} }
var channelList = context.querySelector('.channelList'); var channelList = context.querySelector('.channelsContainer');
channelList.innerHTML = html; channelList.innerHTML = html;
imageLoader.lazyChildren(channelList); imageLoader.lazyChildren(channelList);
} }

View File

@ -0,0 +1,405 @@
define(['events', 'browser', 'pluginManager', 'apphost', 'appSettings'], function (events, browser, pluginManager, appHost, appSettings) {
"use strict";
return function () {
var self = this;
self.name = 'Html Audio Player';
self.type = 'mediaplayer';
self.id = 'htmlaudioplayer';
// Let any players created by plugins take priority
self.priority = 1;
var mediaElement;
var currentSrc;
function getSavedVolume() {
return appSettings.get("volume") || 1;
}
function saveVolume(value) {
if (value) {
appSettings.set("volume", value);
}
}
self.canPlayMediaType = function (mediaType) {
return (mediaType || '').toLowerCase() === 'audio';
};
self.getDeviceProfile = function () {
return new Promise(function (resolve, reject) {
require(['browserdeviceprofile'], function (profileBuilder) {
var profile = profileBuilder({
});
resolve(profile);
});
});
};
self.currentSrc = function () {
return currentSrc;
};
self.play = function (options) {
_currentTime = null;
var elem = createMediaElement();
var val = options.url;
elem.crossOrigin = getCrossOriginValue(options.mediaSource);
elem.title = options.title;
// Opera TV guidelines suggest using source elements, so let's do that if we have a valid mimeType
if (options.mimeType && browser.operaTv) {
// Need to do this or we won't be able to restart a new stream
if (elem.currentSrc) {
elem.src = '';
elem.removeAttribute('src');
}
elem.innerHTML = '<source src="' + val + '" type="' + options.mimeType + '">';
} else {
elem.src = val;
}
currentSrc = val;
return playWithPromise(elem);
};
function playWithPromise(elem) {
try {
var promise = elem.play();
if (promise && promise.then) {
// Chrome now returns a promise
return promise.catch(function (e) {
var errorName = (e.name || '').toLowerCase();
// safari uses aborterror
if (errorName === 'notallowederror' ||
errorName === 'aborterror') {
// swallow this error because the user can still click the play button on the video element
return Promise.resolve();
}
return Promise.reject();
});
} else {
return Promise.resolve();
}
} catch (err) {
console.log('error calling video.play: ' + err);
return Promise.reject();
}
}
function getCrossOriginValue(mediaSource) {
return 'anonymous';
}
// Save this for when playback stops, because querying the time at that point might return 0
var _currentTime;
self.currentTime = function (val) {
if (mediaElement) {
if (val != null) {
mediaElement.currentTime = val / 1000;
return;
}
if (_currentTime) {
return _currentTime * 1000;
}
return (mediaElement.currentTime || 0) * 1000;
}
};
self.duration = function (val) {
if (mediaElement) {
var duration = mediaElement.duration;
if (duration && !isNaN(duration) && duration !== Number.POSITIVE_INFINITY && duration !== Number.NEGATIVE_INFINITY) {
return duration * 1000;
}
}
return null;
};
function supportsFade() {
if (browser.tv) {
// Not working on tizen.
// We could possibly enable on other tv's, but all smart tv browsers tend to be pretty primitive
return false;
}
return true;
}
self.stop = function (destroyPlayer) {
cancelFadeTimeout();
var elem = mediaElement;
var src = currentSrc;
if (elem && src) {
if (!destroyPlayer || !supportsFade()) {
if (!elem.paused) {
elem.pause();
}
elem.src = '';
elem.innerHTML = '';
elem.removeAttribute("src");
onEnded();
return Promise.resolve();
}
var originalVolume = elem.volume;
return fade(elem, elem.volume).then(function () {
if (!elem.paused) {
elem.pause();
}
elem.src = '';
elem.innerHTML = '';
elem.removeAttribute("src");
elem.volume = originalVolume;
onEnded();
});
}
return Promise.resolve();
};
self.destroy = function () {
};
var fadeTimeout;
function fade(elem, startingVolume) {
// Need to record the starting volume on each pass rather than querying elem.volume
// This is due to iOS safari not allowing volume changes and always returning the system volume value
var newVolume = Math.max(0, startingVolume - 0.15);
console.log('fading volume to ' + newVolume);
elem.volume = newVolume;
if (newVolume <= 0) {
return Promise.resolve();
}
return new Promise(function (resolve, reject) {
cancelFadeTimeout();
fadeTimeout = setTimeout(function () {
fade(elem, newVolume).then(resolve, reject);
}, 100);
});
}
function cancelFadeTimeout() {
var timeout = fadeTimeout;
if (timeout) {
clearTimeout(timeout);
fadeTimeout = null;
}
}
self.pause = function () {
if (mediaElement) {
mediaElement.pause();
}
};
// This is a retry after error
self.resume = function () {
if (mediaElement) {
mediaElement.play();
}
};
self.unpause = function () {
if (mediaElement) {
mediaElement.play();
}
};
self.paused = function () {
if (mediaElement) {
return mediaElement.paused;
}
return false;
};
self.setVolume = function (val) {
if (mediaElement) {
mediaElement.volume = val / 100;
}
};
self.getVolume = function () {
if (mediaElement) {
return mediaElement.volume * 100;
}
};
self.volumeUp = function () {
self.setVolume(Math.min(self.getVolume() + 2, 100));
};
self.volumeDown = function () {
self.setVolume(Math.max(self.getVolume() - 2, 0));
};
self.setMute = function (mute) {
if (mediaElement) {
mediaElement.muted = mute;
}
};
self.isMuted = function () {
if (mediaElement) {
return mediaElement.muted;
}
return false;
};
function onEnded() {
var stopInfo = {
src: currentSrc
};
events.trigger(self, 'stopped', [stopInfo]);
_currentTime = null;
currentSrc = null;
}
function onTimeUpdate() {
// Get the player position + the transcoding offset
var time = this.currentTime;
_currentTime = time;
events.trigger(self, 'timeupdate');
}
function onVolumeChange() {
if (!fadeTimeout) {
saveVolume(this.volume);
events.trigger(self, 'volumechange');
}
}
function onPlaying() {
events.trigger(self, 'playing');
}
function onPause() {
events.trigger(self, 'pause');
}
function onError() {
var errorCode = this.error ? this.error.code : '';
errorCode = (errorCode || '').toString();
console.log('Media element error code: ' + errorCode);
var type;
switch (errorCode) {
case 1:
// MEDIA_ERR_ABORTED
// This will trigger when changing media while something is playing
return;
case 2:
// MEDIA_ERR_NETWORK
type = 'network';
break;
case 3:
// MEDIA_ERR_DECODE
break;
case 4:
// MEDIA_ERR_SRC_NOT_SUPPORTED
break;
}
//events.trigger(self, 'error', [
//{
// type: type
//}]);
}
function createMediaElement() {
var elem = document.querySelector('.mediaPlayerAudio');
if (!elem) {
elem = document.createElement('audio');
elem.classList.add('mediaPlayerAudio');
elem.classList.add('hide');
document.body.appendChild(elem);
elem.volume = getSavedVolume();
elem.addEventListener('timeupdate', onTimeUpdate);
elem.addEventListener('ended', onEnded);
elem.addEventListener('volumechange', onVolumeChange);
elem.addEventListener('pause', onPause);
elem.addEventListener('playing', onPlaying);
elem.addEventListener('error', onError);
}
mediaElement = elem;
return elem;
}
function onDocumentClick() {
document.removeEventListener('click', onDocumentClick);
var elem = document.createElement('audio');
elem.classList.add('mediaPlayerAudio');
elem.classList.add('hide');
document.body.appendChild(elem);
elem.src = pluginManager.mapPath(self, 'blank.mp3');
elem.play();
setTimeout(function () {
elem.src = '';
elem.removeAttribute("src");
}, 1000);
}
// Mobile browsers don't allow autoplay, so this is a nice workaround
if (!appHost.supports('htmlaudioautoplay')) {
document.addEventListener('click', onDocumentClick);
}
};
});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
.videoPlayerContainer {
position: fixed !important;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
}
.videoPlayerContainer:not(.videoPlayerContainer-withBackdrop) {
background: #000 !important;
}
.videoPlayerContainer-withBackdrop {
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
background-attachment: fixed;
background-color: #000;
}
.videoPlayerContainer-onTop {
z-index: 1000;
}
.htmlvideoplayer {
margin: 0 !important;
padding: 0 !important;
width: 100%;
height: 100%;
}
.htmlvideoplayer::-webkit-media-text-track-display {
/*Style the text itself*/
margin-top: -2.5em;
}
.htmlvideoplayer::cue {
background-color: transparent;
text-shadow: 2px 2px 2px rgba(0, 0, 0, 1);
-webkit-font-smoothing: antialiased;
font-family: inherit;
}

View File

@ -9,6 +9,10 @@ define(['css!./indicators.css', 'material-icons'], function () {
} }
} }
if (item.Type === 'AudioBook' || item.Type === 'AudioPodcast') {
return true;
}
return false; return false;
} }

View File

@ -89,7 +89,7 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus
return; return;
case 'SetVolume': case 'SetVolume':
notifyApp(); notifyApp();
playbackManager.volume(cmd.Arguments.Volume); playbackManager.setVolume(cmd.Arguments.Volume);
break; break;
case 'SetAudioStreamIndex': case 'SetAudioStreamIndex':
notifyApp(); notifyApp();
@ -196,10 +196,7 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus
events.on(apiClient, "websocketmessage", onWebSocketMessageReceived); events.on(apiClient, "websocketmessage", onWebSocketMessageReceived);
} }
var current = connectionManager.currentApiClient(); connectionManager.getApiClients().forEach(bindEvents);
if (current) {
bindEvents(current);
}
events.on(connectionManager, 'apiclientcreated', function (e, newApiClient) { events.on(connectionManager, 'apiclientcreated', function (e, newApiClient) {

View File

@ -0,0 +1,341 @@
// # The MIT License (MIT)
// #
// # Copyright (c) 2016 Microsoft. All rights reserved.
// #
// # Permission is hereby granted, free of charge, to any person obtaining a copy
// # of this software and associated documentation files (the "Software"), to deal
// # in the Software without restriction, including without limitation the rights
// # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// # copies of the Software, and to permit persons to whom the Software is
// # furnished to do so, subject to the following conditions:
// #
// # The above copyright notice and this permission notice shall be included in
// # all copies or substantial portions of the Software.
// #
// # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// # THE SOFTWARE.
(function () {
"use strict";
var _GAMEPAD_A_BUTTON_INDEX = 0,
_GAMEPAD_B_BUTTON_INDEX = 1,
_GAMEPAD_DPAD_UP_BUTTON_INDEX = 12,
_GAMEPAD_DPAD_DOWN_BUTTON_INDEX = 13,
_GAMEPAD_DPAD_LEFT_BUTTON_INDEX = 14,
_GAMEPAD_DPAD_RIGHT_BUTTON_INDEX = 15,
_GAMEPAD_A_KEY = "GamepadA",
_GAMEPAD_B_KEY = "GamepadB",
_GAMEPAD_DPAD_UP_KEY = "GamepadDPadUp",
_GAMEPAD_DPAD_DOWN_KEY = "GamepadDPadDown",
_GAMEPAD_DPAD_LEFT_KEY = "GamepadDPadLeft",
_GAMEPAD_DPAD_RIGHT_KEY = "GamepadDPadRight",
_GAMEPAD_LEFT_THUMBSTICK_UP_KEY = "GamepadLeftThumbStickUp",
_GAMEPAD_LEFT_THUMBSTICK_DOWN_KEY = "GamepadLeftThumbStickDown",
_GAMEPAD_LEFT_THUMBSTICK_LEFT_KEY = "GamepadLeftThumbStickLeft",
_GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEY = "GamepadLeftThumbStickRight",
_GAMEPAD_A_KEYCODE = 0,
_GAMEPAD_B_KEYCODE = 27,
_GAMEPAD_DPAD_UP_KEYCODE = 38,
_GAMEPAD_DPAD_DOWN_KEYCODE = 40,
_GAMEPAD_DPAD_LEFT_KEYCODE = 37,
_GAMEPAD_DPAD_RIGHT_KEYCODE = 39,
_GAMEPAD_LEFT_THUMBSTICK_UP_KEYCODE = 38,
_GAMEPAD_LEFT_THUMBSTICK_DOWN_KEYCODE = 40,
_GAMEPAD_LEFT_THUMBSTICK_LEFT_KEYCODE = 37,
_GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEYCODE = 39,
_THUMB_STICK_THRESHOLD = 0.75;
var _leftThumbstickUpPressed = false,
_leftThumbstickDownPressed = false,
_leftThumbstickLeftPressed = false,
_leftThumbstickRightPressed = false,
_dPadUpPressed = false,
_dPadDownPressed = false,
_dPadLeftPressed = false,
_dPadRightPressed = false,
_gamepadAPressed = false,
_gamepadBPressed = false;
// The set of buttons on the gamepad we listen for.
var ProcessedButtons = [
_GAMEPAD_DPAD_UP_BUTTON_INDEX,
_GAMEPAD_DPAD_DOWN_BUTTON_INDEX,
_GAMEPAD_DPAD_LEFT_BUTTON_INDEX,
_GAMEPAD_DPAD_RIGHT_BUTTON_INDEX,
_GAMEPAD_A_BUTTON_INDEX,
_GAMEPAD_B_BUTTON_INDEX
];
var _ButtonPressedState = {};
_ButtonPressedState.getgamepadA = function () {
return _gamepadAPressed;
};
_ButtonPressedState.setgamepadA = function (newPressedState) {
raiseKeyEvent(_gamepadAPressed, newPressedState, _GAMEPAD_A_KEY, _GAMEPAD_A_KEYCODE, false, true);
_gamepadAPressed = newPressedState;
};
_ButtonPressedState.getgamepadB = function () {
return _gamepadBPressed;
};
_ButtonPressedState.setgamepadB = function (newPressedState) {
raiseKeyEvent(_gamepadBPressed, newPressedState, _GAMEPAD_B_KEY, _GAMEPAD_B_KEYCODE);
_gamepadBPressed = newPressedState;
};
_ButtonPressedState.getleftThumbstickUp = function () {
return _leftThumbstickUpPressed;
};
_ButtonPressedState.setleftThumbstickUp = function (newPressedState) {
raiseKeyEvent(_leftThumbstickUpPressed, newPressedState, _GAMEPAD_LEFT_THUMBSTICK_UP_KEY, _GAMEPAD_LEFT_THUMBSTICK_UP_KEYCODE, true);
_leftThumbstickUpPressed = newPressedState;
};
_ButtonPressedState.getleftThumbstickDown = function () {
return _leftThumbstickDownPressed;
};
_ButtonPressedState.setleftThumbstickDown = function (newPressedState) {
raiseKeyEvent(_leftThumbstickDownPressed, newPressedState, _GAMEPAD_LEFT_THUMBSTICK_DOWN_KEY, _GAMEPAD_LEFT_THUMBSTICK_DOWN_KEYCODE, true);
_leftThumbstickDownPressed = newPressedState;
};
_ButtonPressedState.getleftThumbstickLeft = function () {
return _leftThumbstickLeftPressed;
};
_ButtonPressedState.setleftThumbstickLeft = function (newPressedState) {
raiseKeyEvent(_leftThumbstickLeftPressed, newPressedState, _GAMEPAD_LEFT_THUMBSTICK_LEFT_KEY, _GAMEPAD_LEFT_THUMBSTICK_LEFT_KEYCODE, true);
_leftThumbstickLeftPressed = newPressedState;
};
_ButtonPressedState.getleftThumbstickRight = function () {
return _leftThumbstickRightPressed;
};
_ButtonPressedState.setleftThumbstickRight = function (newPressedState) {
raiseKeyEvent(_leftThumbstickRightPressed, newPressedState, _GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEY, _GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEYCODE, true);
_leftThumbstickRightPressed = newPressedState;
};
_ButtonPressedState.getdPadUp = function () {
return _dPadUpPressed;
};
_ButtonPressedState.setdPadUp = function (newPressedState) {
raiseKeyEvent(_dPadUpPressed, newPressedState, _GAMEPAD_DPAD_UP_KEY, _GAMEPAD_DPAD_UP_KEYCODE, true);
_dPadUpPressed = newPressedState;
};
_ButtonPressedState.getdPadDown = function () {
return _dPadDownPressed;
};
_ButtonPressedState.setdPadDown = function (newPressedState) {
raiseKeyEvent(_dPadDownPressed, newPressedState, _GAMEPAD_DPAD_DOWN_KEY, _GAMEPAD_DPAD_DOWN_KEYCODE, true);
_dPadDownPressed = newPressedState;
};
_ButtonPressedState.getdPadLeft = function () {
return _dPadLeftPressed;
};
_ButtonPressedState.setdPadLeft = function (newPressedState) {
raiseKeyEvent(_dPadLeftPressed, newPressedState, _GAMEPAD_DPAD_LEFT_KEY, _GAMEPAD_DPAD_LEFT_KEYCODE, true);
_dPadLeftPressed = newPressedState;
};
_ButtonPressedState.getdPadRight = function () {
return _dPadRightPressed;
};
_ButtonPressedState.setdPadRight = function (newPressedState) {
raiseKeyEvent(_dPadRightPressed, newPressedState, _GAMEPAD_DPAD_RIGHT_KEY, _GAMEPAD_DPAD_RIGHT_KEYCODE, true);
_dPadRightPressed = newPressedState;
};
var times = {};
function throttle(key) {
var time = times[key] || 0;
var now = new Date().getTime();
if ((now - time) >= 200) {
//times[key] = now;
return true;
}
return false;
}
function resetThrottle(key) {
times[key] = new Date().getTime();
}
function raiseEvent(name, key, keyCode) {
var event = document.createEvent('Event');
event.initEvent(name, true, true);
event.key = key;
event.keyCode = keyCode;
(document.activeElement || document.body).dispatchEvent(event);
}
function raiseKeyEvent(oldPressedState, newPressedState, key, keyCode, enableRepeatKeyDown, clickonKeyUp) {
// No-op if oldPressedState === newPressedState
if (newPressedState === true) {
// button down
var fire = false;
// always fire if this is the initial down press
if (oldPressedState === false) {
fire = true;
resetThrottle(key);
} else if (enableRepeatKeyDown) {
fire = throttle(key);
}
if (fire && keyCode) {
raiseEvent("keydown", key, keyCode);
}
} else if (newPressedState === false && oldPressedState === true) {
resetThrottle(key);
// button up
if (keyCode) {
raiseEvent("keyup", key, keyCode);
}
if (clickonKeyUp) {
(document.activeElement || window).click();
}
}
}
function runInputLoop() {
// Get the latest gamepad state.
var gamepads;
if (navigator.getGamepads) {
gamepads = navigator.getGamepads();
} else if (navigator.webkitGetGamepads) {
gamepads = navigator.webkitGetGamepads();
}
gamepads = gamepads || [];
var i, j, len;
for (i = 0, len = gamepads.length; i < len; i++) {
var gamepad = gamepads[i];
if (gamepad) {
// Iterate through the axes
var axes = gamepad.axes;
var leftStickX = axes[0];
var leftStickY = axes[1];
if (leftStickX > _THUMB_STICK_THRESHOLD) { // Right
_ButtonPressedState.setleftThumbstickRight(true);
} else if (leftStickX < -_THUMB_STICK_THRESHOLD) { // Left
_ButtonPressedState.setleftThumbstickLeft(true);
} else if (leftStickY < -_THUMB_STICK_THRESHOLD) { // Up
_ButtonPressedState.setleftThumbstickUp(true);
} else if (leftStickY > _THUMB_STICK_THRESHOLD) { // Down
_ButtonPressedState.setleftThumbstickDown(true);
} else {
_ButtonPressedState.setleftThumbstickLeft(false);
_ButtonPressedState.setleftThumbstickRight(false);
_ButtonPressedState.setleftThumbstickUp(false);
_ButtonPressedState.setleftThumbstickDown(false);
}
// Iterate through the buttons to see if Left thumbstick, DPad, A and B are pressed.
var buttons = gamepad.buttons;
for (j = 0, len = buttons.length; j < len; j++) {
if (ProcessedButtons.indexOf(j) !== -1) {
if (buttons[j].pressed) {
switch (j) {
case _GAMEPAD_DPAD_UP_BUTTON_INDEX:
_ButtonPressedState.setdPadUp(true);
break;
case _GAMEPAD_DPAD_DOWN_BUTTON_INDEX:
_ButtonPressedState.setdPadDown(true);
break;
case _GAMEPAD_DPAD_LEFT_BUTTON_INDEX:
_ButtonPressedState.setdPadLeft(true);
break;
case _GAMEPAD_DPAD_RIGHT_BUTTON_INDEX:
_ButtonPressedState.setdPadRight(true);
break;
case _GAMEPAD_A_BUTTON_INDEX:
_ButtonPressedState.setgamepadA(true);
break;
case _GAMEPAD_B_BUTTON_INDEX:
_ButtonPressedState.setgamepadB(true);
break;
default:
// No-op
break;
}
} else {
switch (j) {
case _GAMEPAD_DPAD_UP_BUTTON_INDEX:
if (_ButtonPressedState.getdPadUp()) {
_ButtonPressedState.setdPadUp(false);
}
break;
case _GAMEPAD_DPAD_DOWN_BUTTON_INDEX:
if (_ButtonPressedState.getdPadDown()) {
_ButtonPressedState.setdPadDown(false);
}
break;
case _GAMEPAD_DPAD_LEFT_BUTTON_INDEX:
if (_ButtonPressedState.getdPadLeft()) {
_ButtonPressedState.setdPadLeft(false);
}
break;
case _GAMEPAD_DPAD_RIGHT_BUTTON_INDEX:
if (_ButtonPressedState.getdPadRight()) {
_ButtonPressedState.setdPadRight(false);
}
break;
case _GAMEPAD_A_BUTTON_INDEX:
if (_ButtonPressedState.getgamepadA()) {
_ButtonPressedState.setgamepadA(false);
}
break;
case _GAMEPAD_B_BUTTON_INDEX:
if (_ButtonPressedState.getgamepadB()) {
_ButtonPressedState.setgamepadB(false);
}
break;
default:
// No-op
break;
}
}
}
}
}
}
// Schedule the next one
requestAnimationFrame(runInputLoop);
}
runInputLoop();
// The gamepadInputEmulation is a string property that exists in JavaScript UWAs and in WebViews in UWAs.
// It won't exist in Win8.1 style apps or browsers.
if (window.navigator && typeof window.navigator.gamepadInputEmulation === "string") {
// We want the gamepad to provide gamepad VK keyboard events rather than moving a
// mouse like cursor. Set to "keyboard", the gamepad will provide such keyboard events
// and provide input to the DOM navigator.getGamepads API.
window.navigator.gamepadInputEmulation = "gamepad";
}
})();

View File

@ -0,0 +1,113 @@
define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'dom'], function (inputmanager, focusManager, browser, layoutManager, events, dom) {
'use strict';
var self = {};
var lastMouseInputTime = new Date().getTime();
var isMouseIdle;
function mouseIdleTime() {
return new Date().getTime() - lastMouseInputTime;
}
function notifyApp() {
inputmanager.notifyMouseMove();
}
var lastMouseMoveData;
dom.addEventListener(document, 'mousemove', function (e) {
var eventX = e.screenX;
var eventY = e.screenY;
// if coord don't exist how could it move
if (typeof eventX === "undefined" && typeof eventY === "undefined") {
return;
}
var obj = lastMouseMoveData;
if (!obj) {
lastMouseMoveData = {
x: eventX,
y: eventY
};
return;
}
// if coord are same, it didn't move
if (Math.abs(eventX - obj.x) < 10 && Math.abs(eventY - obj.y) < 10) {
return;
}
obj.x = eventX;
obj.y = eventY;
lastMouseInputTime = new Date().getTime();
notifyApp();
if (isMouseIdle) {
isMouseIdle = false;
document.body.classList.remove('mouseIdle');
events.trigger(self, 'mouseactive');
}
}, {
passive: true
});
function onMouseEnter(e) {
var parent = focusManager.focusableParent(e.target);
if (parent) {
focusManager.focus(e.target);
}
}
function enableFocusWithMouse() {
if (!layoutManager.tv) {
return false;
}
if (browser.xboxOne) {
return true;
}
if (browser.tv) {
return true;
}
return false;
}
function initMouseFocus() {
dom.removeEventListener(document, 'mouseenter', onMouseEnter, {
capture: true,
passive: true
});
if (enableFocusWithMouse()) {
dom.addEventListener(document, 'mouseenter', onMouseEnter, {
capture: true,
passive: true
});
}
}
initMouseFocus();
events.on(layoutManager, 'modechange', initMouseFocus);
setInterval(function () {
if (mouseIdleTime() >= 5000) {
isMouseIdle = true;
document.body.classList.add('mouseIdle');
events.trigger(self, 'mouseidle');
}
}, 5000);
return self;
});

View File

@ -146,10 +146,10 @@ define(['playbackManager', 'focusManager', 'embyRouter', 'dom'], function (playb
embyRouter.showLiveTV(); embyRouter.showLiveTV();
break; break;
case 'mute': case 'mute':
playbackManager.mute(); playbackManager.setMute(true);
break; break;
case 'unmute': case 'unmute':
playbackManager.unMute(); playbackManager.setMute(false);
break; break;
case 'togglemute': case 'togglemute':
playbackManager.toggleMute(); playbackManager.toggleMute();

Some files were not shown because too many files have changed in this diff Show More