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:
parent
67524136ed
commit
64dfb8ef38
42 changed files with 945 additions and 370 deletions
77
dashboard-ui/cordova/android/iap.js
vendored
77
dashboard-ui/cordova/android/iap.js
vendored
|
@ -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();
|
||||
|
|
10
dashboard-ui/cordova/iap.js
vendored
10
dashboard-ui/cordova/iap.js
vendored
|
@ -267,12 +267,20 @@
|
|||
return deferred.promise();
|
||||
}
|
||||
|
||||
function isUnlockedOverride(feature) {
|
||||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
deferred.resolveWith(null, [false]);
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
window.IapManager = {
|
||||
isPurchaseAvailable: isPurchaseAvailable,
|
||||
getProductInfo: getProduct,
|
||||
beginPurchase: beginPurchase,
|
||||
restorePurchase: restorePurchase,
|
||||
getSubscriptionOptions: getSubscriptionOptions
|
||||
getSubscriptionOptions: getSubscriptionOptions,
|
||||
isUnlockedOverride: isUnlockedOverride
|
||||
};
|
||||
|
||||
initializeStore();
|
||||
|
|
36
dashboard-ui/cordova/registrationservices.js
vendored
36
dashboard-ui/cordova/registrationservices.js
vendored
|
@ -24,32 +24,40 @@
|
|||
|
||||
var prefix = $.browser.android ? 'android' : 'ios';
|
||||
|
||||
// Get supporter status
|
||||
getRegistrationInfo(prefix + 'appunlock').done(function (registrationInfo) {
|
||||
IapManager.isUnlockedOverride(feature).done(function (isUnlocked) {
|
||||
|
||||
if (registrationInfo.IsRegistered) {
|
||||
if (isUnlocked) {
|
||||
deferred.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
IapManager.getSubscriptionOptions().done(function (subscriptionOptions) {
|
||||
// Get supporter status
|
||||
getRegistrationInfo(prefix + 'appunlock').done(function (registrationInfo) {
|
||||
|
||||
if (subscriptionOptions.filter(function (p) {
|
||||
return p.owned;
|
||||
}).length > 0) {
|
||||
if (registrationInfo.IsRegistered) {
|
||||
deferred.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
var dialogOptions = {
|
||||
title: Globalize.translate('HeaderUnlockApp')
|
||||
};
|
||||
IapManager.getSubscriptionOptions().done(function (subscriptionOptions) {
|
||||
|
||||
showInAppPurchaseInfo(subscriptionOptions, unlockableProductInfo, registrationInfo, dialogOptions, deferred);
|
||||
if (subscriptionOptions.filter(function (p) {
|
||||
return p.owned;
|
||||
}).length > 0) {
|
||||
deferred.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
var dialogOptions = {
|
||||
title: Globalize.translate('HeaderUnlockApp')
|
||||
};
|
||||
|
||||
showInAppPurchaseInfo(subscriptionOptions, unlockableProductInfo, registrationInfo, dialogOptions, deferred);
|
||||
});
|
||||
|
||||
}).fail(function () {
|
||||
deferred.reject();
|
||||
});
|
||||
|
||||
}).fail(function () {
|
||||
deferred.reject();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue