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

encode with qsv

This commit is contained in:
Luke Pulverenti 2015-11-06 10:02:22 -05:00
parent 67524136ed
commit 64dfb8ef38
42 changed files with 945 additions and 370 deletions

View file

@ -92,6 +92,80 @@
return deferred.promise();
}
function isUnlockedOverride(feature) {
var deferred = DeferredBuilder.Deferred();
if (feature == 'playback') {
isPlaybackUnlockedViaOldApp(deferred);
} else if (feature == 'livetv') {
isLiveTvUnlockedViaOldApp(deferred);
} else {
deferred.resolveWith(null, [false]);
}
return deferred.promise();
}
function isPlaybackUnlockedViaOldApp(deferred) {
testDeviceId(ConnectionManager.deviceId()).done(function (isUnlocked) {
if (isUnlocked) {
deferred.resolveWith(null, [true]);
return;
}
testDeviceId(device.uuid).done(function (isUnlocked) {
if (isUnlocked) {
deferred.resolveWith(null, [true]);
return;
}
deferred.resolveWith(null, [false]);
});
});
}
function testDeviceId(deviceId) {
var deferred = DeferredBuilder.Deferred();
var cacheKey = 'oldapp-' + deviceId;
var cacheValue = appStorage.getItem(cacheKey);
if (cacheValue) {
deferred.resolveWith(null, [cacheValue == 'true']);
} else {
HttpClient.send({
type: 'GET',
url: 'https://mb3admin.com/admin/service/statistics/appAccess?application=AndroidV1&deviceId=' + deviceId
}).done(function () {
appStorage.setItem(cacheKey, 'true');
deferred.resolveWith(null, [true]);
}).fail(function (e) {
if (e.status == 404) {
appStorage.setItem(cacheKey, 'false');
}
deferred.resolveWith(null, [false]);
});
}
return deferred.promise();
}
function isLiveTvUnlockedViaOldApp(deferred) {
isPlaybackUnlockedViaOldApp(deferred);
}
window.IapManager = {
isPurchaseAvailable: isPurchaseAvailable,
getProductInfo: getProduct,
@ -99,7 +173,8 @@
beginPurchase: beginPurchase,
onPurchaseComplete: onPurchaseComplete,
getSubscriptionOptions: getSubscriptionOptions,
onStoreReady: onStoreReady
onStoreReady: onStoreReady,
isUnlockedOverride: isUnlockedOverride
};
NativeIapManager.initStore();