@mediakind/mkplayer 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mkplayer.js +1 -1
- package/package.json +2 -2
- package/types/alias/index.d.ts +1 -1
- package/types/classes/common/MKAzukiResponseUtils.js +66 -58
- package/types/classes/common/MKAzukiResponseUtils.js.map +1 -1
- package/types/classes/common/MKEventBase.js +11 -10
- package/types/classes/common/MKEventBase.js.map +1 -1
- package/types/classes/common/MKLocalStorage.js +64 -58
- package/types/classes/common/MKLocalStorage.js.map +1 -1
- package/types/classes/common/MKLog.js +49 -22
- package/types/classes/common/MKLog.js.map +1 -1
- package/types/classes/common/MKPlatform.js +156 -108
- package/types/classes/common/MKPlatform.js.map +1 -1
- package/types/classes/common/MKProgramManager.js +37 -32
- package/types/classes/common/MKProgramManager.js.map +1 -1
- package/types/classes/common/MKSecureUrlManager.js +137 -108
- package/types/classes/common/MKSecureUrlManager.js.map +1 -1
- package/types/classes/common/MKSubtitleOverlay.js +69 -67
- package/types/classes/common/MKSubtitleOverlay.js.map +1 -1
- package/types/classes/common/MKThumbnailManager.js +261 -211
- package/types/classes/common/MKThumbnailManager.js.map +1 -1
- package/types/classes/common/MKUtils.js +162 -100
- package/types/classes/common/MKUtils.js.map +1 -1
- package/types/classes/error/MKAdobeSessionConcurrencyError.js +6 -5
- package/types/classes/error/MKAdobeSessionConcurrencyError.js.map +1 -1
- package/types/classes/error/MKAzukiRequestError.js +8 -7
- package/types/classes/error/MKAzukiRequestError.js.map +1 -1
- package/types/classes/error/MKBitmovinPlayerError.js +31 -12
- package/types/classes/error/MKBitmovinPlayerError.js.map +1 -1
- package/types/classes/error/MKHttpError.js +4 -3
- package/types/classes/error/MKHttpError.js.map +1 -1
- package/types/classes/error/MKPlayerError.js +5 -4
- package/types/classes/error/MKPlayerError.js.map +1 -1
- package/types/classes/error/MKProgramRestrictionError.js +11 -10
- package/types/classes/error/MKProgramRestrictionError.js.map +1 -1
- package/types/classes/player/MKBitmovinPlayer.js +620 -553
- package/types/classes/player/MKBitmovinPlayer.js.map +1 -1
- package/types/classes/player/MKPlayer.d.ts +4 -0
- package/types/classes/player/MKPlayer.js +734 -528
- package/types/classes/player/MKPlayer.js.map +1 -1
- package/types/classes/player/MKStubPlayer.js +263 -273
- package/types/classes/player/MKStubPlayer.js.map +1 -1
- package/types/classes/request/MKAdobeSessionConcurrencyRequest.js +198 -127
- package/types/classes/request/MKAdobeSessionConcurrencyRequest.js.map +1 -1
- package/types/classes/request/MKAzukiRequest.js +381 -268
- package/types/classes/request/MKAzukiRequest.js.map +1 -1
- package/types/classes/request/MKHttpRequest.js +128 -89
- package/types/classes/request/MKHttpRequest.js.map +1 -1
- package/types/constants/MKAzukiRequestEndpoint.js +24 -24
- package/types/constants/MKAzukiRequestEndpoint.js.map +1 -1
- package/types/constants/MKConstants.js +1 -1
- package/types/enums/MKAnalyticsDataName.d.ts +8 -0
- package/types/enums/MKAnalyticsDataName.js +13 -0
- package/types/enums/MKAnalyticsDataName.js.map +1 -0
- package/types/enums/MKErrorCode.d.ts +1 -0
- package/types/enums/MKErrorCode.js +1 -0
- package/types/enums/MKErrorCode.js.map +1 -1
- package/types/enums/MKPlayerEvent.d.ts +6 -1
- package/types/enums/MKPlayerEvent.js +5 -0
- package/types/enums/MKPlayerEvent.js.map +1 -1
- package/types/enums/MKProgramRestrictionType.js.map +1 -1
- package/types/enums/index.d.ts +1 -0
- package/types/enums/index.js +3 -1
- package/types/enums/index.js.map +1 -1
- package/types/interfaces/MKAdaptationPlatformConfig.js +1 -1
- package/types/interfaces/MKAdaptationPlatformConfig.js.map +1 -1
- package/types/interfaces/MKBufferConfig.js +1 -1
- package/types/interfaces/MKBufferConfig.js.map +1 -1
- package/types/interfaces/MKBufferMediaTypeConfig.js +1 -1
- package/types/interfaces/MKBufferMediaTypeConfig.js.map +1 -1
- package/types/interfaces/MKDrmConfig.js +1 -1
- package/types/interfaces/MKDrmConfig.js.map +1 -1
- package/types/interfaces/MKRegisteredSource.d.ts +1 -0
- package/types/interfaces/events/MKAnalyticsDataEvent.d.ts +6 -0
- package/types/interfaces/events/MKAnalyticsDataEvent.js +3 -0
- package/types/interfaces/events/MKAnalyticsDataEvent.js.map +1 -0
- package/types/interfaces/events/MKAudioPlaybackQualityChangedEvent.d.ts +2 -1
- package/types/interfaces/events/MKMediaPlaybackQualityChangeEvent.d.ts +3 -3
- package/types/interfaces/events/MKVSPPSessionIdEvent.d.ts +4 -0
- package/types/interfaces/events/MKVSPPSessionIdEvent.js +3 -0
- package/types/interfaces/events/MKVSPPSessionIdEvent.js.map +1 -0
- package/types/interfaces/events/MKVideoPlaybackQualityChangedEvent.d.ts +2 -1
- package/types/interfaces/events/index.d.ts +2 -0
- package/types/src/alias/index.d.ts +1 -1
- package/types/src/classes/player/MKPlayer.d.ts +4 -0
- package/types/src/enums/MKAnalyticsDataName.d.ts +8 -0
- package/types/src/enums/MKErrorCode.d.ts +1 -0
- package/types/src/enums/MKPlayerEvent.d.ts +6 -1
- package/types/src/enums/index.d.ts +1 -0
- package/types/src/interfaces/MKRegisteredSource.d.ts +1 -0
- package/types/src/interfaces/events/MKAnalyticsDataEvent.d.ts +6 -0
- package/types/src/interfaces/events/MKAudioPlaybackQualityChangedEvent.d.ts +2 -1
- package/types/src/interfaces/events/MKMediaPlaybackQualityChangeEvent.d.ts +3 -3
- package/types/src/interfaces/events/MKVSPPSessionIdEvent.d.ts +4 -0
- package/types/src/interfaces/events/MKVideoPlaybackQualityChangedEvent.d.ts +2 -1
- package/types/src/interfaces/events/index.d.ts +2 -0
- package/types/plugins/fmts/MKFMTSConfig.d.ts +0 -10
- package/types/plugins/fmts/MKFMTSController.d.ts +0 -39
- package/types/plugins/fmts/MKFMTSUtils.d.ts +0 -4
- package/types/plugins/fmts/index.d.ts +0 -2
- package/types/plugins/omsdk/MKOMSDKConfig.d.ts +0 -6
- package/types/plugins/omsdk/MKOMSDKConstants.d.ts +0 -152
- package/types/plugins/omsdk/MKOMSDKController.d.ts +0 -58
- package/types/plugins/omsdk/index.d.ts +0 -2
|
@@ -8,73 +8,120 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
11
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
39
|
exports.MKPlatform = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const localStorage = MKLocalStorage_1.MKLocalStorage.getInstance();
|
|
21
|
-
const deviceProfile = localStorage.getDeviceProfile();
|
|
22
|
-
if (deviceProfile)
|
|
23
|
-
return deviceProfile;
|
|
24
|
-
const currentDeviceProfile = {
|
|
25
|
-
model: this.isChromeCast() ? "ChromeCast" : (this.isDesktopChromeBrowser() || this.isChromebook() || this.isFirefox() || this.isEdge() || this.isOpera() || this.isSafari()) ? "Desktop" : this.isTizenTV() || this.isWebOS() || this.isOperaTV() ? "TV" : this.isComcastX1() ? "STB" : (this.isXbox() || this.isPlayStation5() || this.isPlayStation4()) ? "CONSOLE" : (this.isAndroid() || this.isIOSDevice() || this.isIOSWebView()) ? "MOBILE" : "Unknown",
|
|
26
|
-
osVersion: platform.os.version || platform.version,
|
|
27
|
-
vendorName: this.getOSVendorName(),
|
|
28
|
-
osName: this.getDrmForPlatform(),
|
|
29
|
-
deviceUUID: this.getDeviceId(),
|
|
30
|
-
wvLevel: this.getDrmForPlatform() === "HTML5" ? yield this.getWidevineSecurityLevel() : undefined
|
|
31
|
-
};
|
|
32
|
-
localStorage.clearRegistered();
|
|
33
|
-
const encodedDeviceProfile = MKUtils_1.MKUtils.base64Encode(JSON.stringify(currentDeviceProfile));
|
|
34
|
-
localStorage.setDeviceProfile(encodedDeviceProfile);
|
|
35
|
-
return encodedDeviceProfile;
|
|
36
|
-
});
|
|
40
|
+
var platform = require("platform");
|
|
41
|
+
var MKUtils_1 = require("./MKUtils");
|
|
42
|
+
var constants_1 = require("../../constants");
|
|
43
|
+
var MKLocalStorage_1 = require("./MKLocalStorage");
|
|
44
|
+
var MKPlatform = (function () {
|
|
45
|
+
function MKPlatform() {
|
|
37
46
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
MKPlatform.getDeviceProfile = function () {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49
|
+
var localStorage, deviceProfile, currentDeviceProfile, _a, encodedDeviceProfile;
|
|
50
|
+
var _b;
|
|
51
|
+
return __generator(this, function (_c) {
|
|
52
|
+
switch (_c.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
localStorage = MKLocalStorage_1.MKLocalStorage.getInstance();
|
|
55
|
+
deviceProfile = localStorage.getDeviceProfile();
|
|
56
|
+
if (deviceProfile)
|
|
57
|
+
return [2, deviceProfile];
|
|
58
|
+
_b = {
|
|
59
|
+
model: this.isChromeCast() ? "ChromeCast" : (this.isDesktopChromeBrowser() || this.isChromebook() || this.isFirefox() || this.isEdge() || this.isOpera() || this.isSafari()) ? "Desktop" : this.isTizenTV() || this.isWebOS() || this.isOperaTV() ? "TV" : this.isComcastX1() ? "STB" : (this.isXbox() || this.isPlayStation5() || this.isPlayStation4()) ? "CONSOLE" : (this.isAndroid() || this.isIOSDevice() || this.isIOSWebView()) ? "MOBILE" : "Unknown",
|
|
60
|
+
osVersion: platform.os.version || platform.version,
|
|
61
|
+
vendorName: this.getOSVendorName(),
|
|
62
|
+
osName: this.getDrmForPlatform(),
|
|
63
|
+
deviceUUID: this.getDeviceId()
|
|
64
|
+
};
|
|
65
|
+
if (!(this.getDrmForPlatform() === "HTML5")) return [3, 2];
|
|
66
|
+
return [4, this.getWidevineSecurityLevel()];
|
|
67
|
+
case 1:
|
|
68
|
+
_a = _c.sent();
|
|
69
|
+
return [3, 3];
|
|
70
|
+
case 2:
|
|
71
|
+
_a = undefined;
|
|
72
|
+
_c.label = 3;
|
|
73
|
+
case 3:
|
|
74
|
+
currentDeviceProfile = (_b.wvLevel = _a,
|
|
75
|
+
_b);
|
|
76
|
+
localStorage.clearRegistered();
|
|
77
|
+
encodedDeviceProfile = MKUtils_1.MKUtils.base64Encode(JSON.stringify(currentDeviceProfile));
|
|
78
|
+
localStorage.setDeviceProfile(encodedDeviceProfile);
|
|
79
|
+
return [2, encodedDeviceProfile];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
MKPlatform.getDeviceId = function () {
|
|
85
|
+
var localStorage = MKLocalStorage_1.MKLocalStorage.getInstance();
|
|
86
|
+
var deviceId = localStorage.getDeviceId();
|
|
41
87
|
if (deviceId)
|
|
42
88
|
return deviceId;
|
|
43
|
-
|
|
89
|
+
var currentDeviceId = MKUtils_1.MKUtils.getUUID().replace("-", "");
|
|
44
90
|
localStorage.clearRegistered();
|
|
45
91
|
localStorage.setDeviceId(currentDeviceId);
|
|
46
92
|
return currentDeviceId;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
93
|
+
};
|
|
94
|
+
MKPlatform.getWidevineSecurityLevel = function () {
|
|
95
|
+
var _this = this;
|
|
96
|
+
return new Promise(function (resolve, _) {
|
|
50
97
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
98
|
+
var keySystem = "com.widevine.alpha";
|
|
99
|
+
var config = [{
|
|
53
100
|
'videoCapabilities': [{
|
|
54
101
|
'robustness': 'HW_SECURE_ALL',
|
|
55
102
|
'contentType': 'video/mp4;codecs="avc1.42800C"'
|
|
56
103
|
}]
|
|
57
104
|
}];
|
|
58
105
|
navigator.requestMediaKeySystemAccess(keySystem, config)
|
|
59
|
-
.then((keySystemAccess)
|
|
106
|
+
.then(function (keySystemAccess) {
|
|
60
107
|
return keySystemAccess.createMediaKeys();
|
|
61
108
|
})
|
|
62
|
-
.then(()
|
|
109
|
+
.then(function () {
|
|
63
110
|
return resolve("L1");
|
|
64
111
|
})
|
|
65
|
-
.catch((_error)
|
|
112
|
+
.catch(function (_error) {
|
|
66
113
|
return resolve("L3");
|
|
67
114
|
});
|
|
68
115
|
}
|
|
69
116
|
catch (_a) {
|
|
70
|
-
if (
|
|
117
|
+
if (_this.isOperaTV() || _this.isTizenTV()) {
|
|
71
118
|
return resolve("L1");
|
|
72
119
|
}
|
|
73
120
|
return resolve("L3");
|
|
74
121
|
}
|
|
75
122
|
});
|
|
76
|
-
}
|
|
77
|
-
|
|
123
|
+
};
|
|
124
|
+
MKPlatform.getDrmForPlatform = function () {
|
|
78
125
|
if (this.isIOSFamily()) {
|
|
79
126
|
return constants_1.MKConstants.DrmPlatform.Fairplay;
|
|
80
127
|
}
|
|
@@ -84,8 +131,8 @@ class MKPlatform {
|
|
|
84
131
|
else {
|
|
85
132
|
return constants_1.MKConstants.DrmPlatform.Widevine;
|
|
86
133
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
134
|
+
};
|
|
135
|
+
MKPlatform.getOSVendorName = function () {
|
|
89
136
|
if (this.isWindows()) {
|
|
90
137
|
return "Microsoft";
|
|
91
138
|
}
|
|
@@ -125,88 +172,89 @@ class MKPlatform {
|
|
|
125
172
|
else {
|
|
126
173
|
return "Unknown";
|
|
127
174
|
}
|
|
128
|
-
}
|
|
129
|
-
|
|
175
|
+
};
|
|
176
|
+
MKPlatform.isIE = function () {
|
|
130
177
|
return platform.name === "IE";
|
|
131
|
-
}
|
|
132
|
-
|
|
178
|
+
};
|
|
179
|
+
MKPlatform.isEdge = function () {
|
|
133
180
|
return platform.name === "Microsoft Edge" && (this.isMac() || this.isWindows()) && !this.isXbox();
|
|
134
|
-
}
|
|
135
|
-
|
|
181
|
+
};
|
|
182
|
+
MKPlatform.isMac = function () {
|
|
136
183
|
return platform.os.family === "OS X";
|
|
137
|
-
}
|
|
138
|
-
|
|
184
|
+
};
|
|
185
|
+
MKPlatform.isWindows = function () {
|
|
139
186
|
return platform.os.family === "Windows" || platform.os.family === "Windows NT 10.0" || platform.os.family === "Windows Server 2008 R2 / 7";
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return this.isWindows() && platform.ua.includes('Xbox');
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return platform.ua.includes("AppleWebKit") && platform.ua.includes("PlayStation 5");
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return platform.ua.includes("AppleWebKit") && platform.ua.includes("PlayStation") && platform.ua.includes("WebMAF");
|
|
149
|
-
}
|
|
150
|
-
|
|
187
|
+
};
|
|
188
|
+
MKPlatform.isXbox = function () {
|
|
189
|
+
return this.isWindows() && platform.ua && platform.ua.includes('Xbox');
|
|
190
|
+
};
|
|
191
|
+
MKPlatform.isPlayStation5 = function () {
|
|
192
|
+
return platform.ua && platform.ua.includes("AppleWebKit") && platform.ua.includes("PlayStation 5");
|
|
193
|
+
};
|
|
194
|
+
MKPlatform.isPlayStation4 = function () {
|
|
195
|
+
return platform.ua && platform.ua.includes("AppleWebKit") && platform.ua.includes("PlayStation") && platform.ua.includes("WebMAF");
|
|
196
|
+
};
|
|
197
|
+
MKPlatform.isSafari = function () {
|
|
151
198
|
return platform.name === "Safari" && this.isMac();
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return (platform.ua.includes("iPhone") || platform.ua.includes("iPad")) && platform.os.family === 'iOS';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return (!platform.name || (!this.isEdge() && !this.isChrome() && !this.isFirefox() && !this.isOpera())) && (platform.ua.includes("AppleWebKit")) && (platform.os.family === "OS X");
|
|
158
|
-
}
|
|
159
|
-
|
|
199
|
+
};
|
|
200
|
+
MKPlatform.isIOSDevice = function () {
|
|
201
|
+
return platform.ua && (platform.ua.includes("iPhone") || platform.ua.includes("iPad")) && platform.os.family === 'iOS';
|
|
202
|
+
};
|
|
203
|
+
MKPlatform.isIOSWebView = function () {
|
|
204
|
+
return (!platform.name || (!this.isEdge() && !this.isChrome() && !this.isFirefox() && !this.isOpera())) && (platform.ua && platform.ua.includes("AppleWebKit")) && (platform.os.family === "OS X");
|
|
205
|
+
};
|
|
206
|
+
MKPlatform.isChrome = function () {
|
|
160
207
|
return platform.name === "Chrome" && !this.isComcastX1() && !this.isOperaTV() && !this.isChromebook();
|
|
161
|
-
}
|
|
162
|
-
|
|
208
|
+
};
|
|
209
|
+
MKPlatform.isFirefox = function () {
|
|
163
210
|
return platform.name === "Firefox";
|
|
164
|
-
}
|
|
165
|
-
|
|
211
|
+
};
|
|
212
|
+
MKPlatform.isOpera = function () {
|
|
166
213
|
return platform.name === "Opera" && (this.isMac() || this.isWindows());
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return platform.ua.includes("AppleWebKit") && (platform.ua.includes("WPE") || platform.ua.includes("XiOne") || platform.ua.includes("Sky"));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return ((platform.ua.includes("Hisense;SmartTV;") || platform.ua.includes("Onida;SmartTV;")) && platform.ua.includes("Model/Hisense") && platform.ua.includes("VIDAA"));
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return platform.ua.includes("CrOS") && !this.isDesktopChromeBrowser();
|
|
176
|
-
}
|
|
177
|
-
|
|
214
|
+
};
|
|
215
|
+
MKPlatform.isComcastX1 = function () {
|
|
216
|
+
return platform.ua && platform.ua.includes("AppleWebKit") && (platform.ua.includes("WPE") || platform.ua.includes("XiOne") || platform.ua.includes("Sky"));
|
|
217
|
+
};
|
|
218
|
+
MKPlatform.isOperaTV = function () {
|
|
219
|
+
return platform.ua && ((platform.ua.includes("Hisense;SmartTV;") || platform.ua.includes("Onida;SmartTV;")) && platform.ua.includes("Model/Hisense") && platform.ua.includes("VIDAA"));
|
|
220
|
+
};
|
|
221
|
+
MKPlatform.isChromebook = function () {
|
|
222
|
+
return platform.ua && platform.ua.includes("CrOS") && !this.isDesktopChromeBrowser();
|
|
223
|
+
};
|
|
224
|
+
MKPlatform.isDesktopChromeBrowser = function () {
|
|
178
225
|
return (this.isMac() || this.isWindows()) && (this.isChrome() || this.isEdge()) && (!this.isXbox() || !this.isWebOS() || !this.isTizenTV());
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return this.isChrome() && this.isLinux() && platform.ua.includes("Web0S");
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return platform.name === "Safari" && platform.os.family === "Tizen" && platform.ua.includes("SMART-TV; LINUX; Tizen");
|
|
185
|
-
}
|
|
186
|
-
|
|
226
|
+
};
|
|
227
|
+
MKPlatform.isWebOS = function () {
|
|
228
|
+
return this.isChrome() && this.isLinux() && platform.ua && platform.ua.includes("Web0S");
|
|
229
|
+
};
|
|
230
|
+
MKPlatform.isTizenTV = function () {
|
|
231
|
+
return platform.name === "Safari" && platform.os.family === "Tizen" && platform.ua && platform.ua.includes("SMART-TV; LINUX; Tizen");
|
|
232
|
+
};
|
|
233
|
+
MKPlatform.isLinux = function () {
|
|
187
234
|
return platform.os.family.includes("Linux");
|
|
188
|
-
}
|
|
189
|
-
|
|
235
|
+
};
|
|
236
|
+
MKPlatform.isIOSFamily = function () {
|
|
190
237
|
return (this.isSafari() || this.isIOSDevice() || this.isIOSWebView());
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return this.isChrome() && (this.isLinux() || this.isAndroid()) && platform.ua.includes("CrKey");
|
|
194
|
-
}
|
|
195
|
-
|
|
238
|
+
};
|
|
239
|
+
MKPlatform.isChromeCast = function () {
|
|
240
|
+
return this.isChrome() && (this.isLinux() || this.isAndroid()) && platform.ua && platform.ua.includes("CrKey");
|
|
241
|
+
};
|
|
242
|
+
MKPlatform.isAndroid = function () {
|
|
196
243
|
return platform.os.family && platform.os.family.includes("Android");
|
|
197
|
-
}
|
|
198
|
-
|
|
244
|
+
};
|
|
245
|
+
MKPlatform.isTablet = function () {
|
|
199
246
|
var isTablet = /android|ipad|tablet/i.test(navigator.userAgent);
|
|
200
247
|
return isTablet;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
248
|
+
};
|
|
249
|
+
MKPlatform.isPhone = function () {
|
|
250
|
+
var isPhone = this.isAndroid() || this.isIOSDevice();
|
|
204
251
|
return isPhone;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
252
|
+
};
|
|
253
|
+
MKPlatform.isDesktop = function () {
|
|
254
|
+
var isDesktop = (this.isMac() || this.isWindows()) && (!this.isXbox() || !this.isWebOS() || !this.isTizenTV() || !this.isComcastX1());
|
|
208
255
|
return isDesktop;
|
|
209
|
-
}
|
|
210
|
-
|
|
256
|
+
};
|
|
257
|
+
return MKPlatform;
|
|
258
|
+
}());
|
|
211
259
|
exports.MKPlatform = MKPlatform;
|
|
212
260
|
//# sourceMappingURL=MKPlatform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MKPlatform.js","sourceRoot":"","sources":["../../../../../src/classes/common/MKPlatform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MKPlatform.js","sourceRoot":"","sources":["../../../../../src/classes/common/MKPlatform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACrC,qCAAoC;AACpC,6CAA8C;AAC9C,mDAAkD;AAQlD;IAAA;IAqQA,CAAC;IA/PuB,2BAAgB,GAApC;;;;;;;wBAEU,YAAY,GAAG,+BAAc,CAAC,WAAW,EAAE,CAAC;wBAC5C,aAAa,GAAG,YAAY,CAAC,gBAAgB,EAAE,CAAC;wBACtD,IAAI,aAAa;4BAAE,WAAO,aAAa,EAAC;;4BAIpC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE,IAAI,IAAI,CAAC,SAAS,EAAE,IAAI,I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AAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACvD,OAAO,OAAO,CAAC;IACnB,CAAC;IAEa,oBAAS,GAAvB;QACI,IAAM,SAAS,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACxI,OAAO,SAAS,CAAC;IACrB,CAAC;IACL,iBAAC;AAAD,CAAC,AArQD,IAqQC;AArQqB,gCAAU"}
|
|
@@ -1,48 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MKProgramManager = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var MKLog_1 = require("./MKLog");
|
|
5
|
+
var MKUtils_1 = require("./MKUtils");
|
|
6
|
+
var MKProgramManager = (function () {
|
|
7
|
+
function MKProgramManager(azukiRequest) {
|
|
8
8
|
this.programInfoList = [];
|
|
9
9
|
this.azukiRequest = azukiRequest;
|
|
10
10
|
if (!this.azukiRequest) {
|
|
11
11
|
MKLog_1.MKLog.error("[MKProgramManager] invalid azuki request handle!");
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
reset() {
|
|
14
|
+
MKProgramManager.prototype.reset = function () {
|
|
15
15
|
this.programInfoList = [];
|
|
16
|
-
}
|
|
17
|
-
updateProgramInfoList(currentProgramInfo) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
};
|
|
17
|
+
MKProgramManager.prototype.updateProgramInfoList = function (currentProgramInfo) {
|
|
18
|
+
var _this = this;
|
|
19
|
+
return new Promise(function (resolve) {
|
|
20
|
+
if (currentProgramInfo.timeRange && _this.azukiRequest) {
|
|
21
|
+
_this.currentProgramInfo = currentProgramInfo;
|
|
22
|
+
var startDate = MKUtils_1.MKUtils.timestampToISOString((currentProgramInfo.timeRange.start - 60) * 1000);
|
|
23
|
+
var endDate = MKUtils_1.MKUtils.timestampToISOString((currentProgramInfo.timeRange.end + 60) * 1000);
|
|
24
|
+
_this.azukiRequest.programInfoRequest(startDate, endDate)
|
|
25
|
+
.then(function (programInfoList) {
|
|
26
|
+
if (programInfoList.length > 0) {
|
|
27
|
+
_this.programInfoList = programInfoList;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
_this.programInfoList = [];
|
|
31
|
+
_this.programInfoList.push(currentProgramInfo);
|
|
32
|
+
}
|
|
33
|
+
resolve();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
MKProgramManager.prototype.validateProgramRestrictions = function (programInfo) {
|
|
35
39
|
if (programInfo.programRestrictions.playbackBlocking.length > 0) {
|
|
36
40
|
throw programInfo.programRestrictions.playbackBlocking[0];
|
|
37
41
|
}
|
|
38
42
|
return programInfo.programRestrictions.controlBlocking;
|
|
39
|
-
}
|
|
40
|
-
checkProgramBoundary(currentTime) {
|
|
43
|
+
};
|
|
44
|
+
MKProgramManager.prototype.checkProgramBoundary = function (currentTime) {
|
|
41
45
|
var _a;
|
|
42
46
|
if ((_a = this.currentProgramInfo) === null || _a === void 0 ? void 0 : _a.timeRange) {
|
|
43
47
|
if (currentTime < this.currentProgramInfo.timeRange.start || currentTime > this.currentProgramInfo.timeRange.end) {
|
|
44
48
|
MKLog_1.MKLog.debug("[MKProgramManager] program boundary crossed.");
|
|
45
|
-
|
|
49
|
+
var programInfo = this.getProgramInfo(currentTime);
|
|
46
50
|
if (programInfo) {
|
|
47
51
|
this.updateProgramInfoList(programInfo);
|
|
48
52
|
return programInfo;
|
|
@@ -54,9 +58,9 @@ class MKProgramManager {
|
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
return null;
|
|
57
|
-
}
|
|
58
|
-
getProgramInfo(currentTime) {
|
|
59
|
-
|
|
61
|
+
};
|
|
62
|
+
MKProgramManager.prototype.getProgramInfo = function (currentTime) {
|
|
63
|
+
var index = this.programInfoList.findIndex(function (programInfo) {
|
|
60
64
|
if (programInfo.timeRange) {
|
|
61
65
|
return currentTime >= programInfo.timeRange.start && currentTime < programInfo.timeRange.end;
|
|
62
66
|
}
|
|
@@ -66,7 +70,8 @@ class MKProgramManager {
|
|
|
66
70
|
return this.programInfoList[index];
|
|
67
71
|
}
|
|
68
72
|
return null;
|
|
69
|
-
}
|
|
70
|
-
|
|
73
|
+
};
|
|
74
|
+
return MKProgramManager;
|
|
75
|
+
}());
|
|
71
76
|
exports.MKProgramManager = MKProgramManager;
|
|
72
77
|
//# sourceMappingURL=MKProgramManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MKProgramManager.js","sourceRoot":"","sources":["../../../../../src/classes/common/MKProgramManager.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"MKProgramManager.js","sourceRoot":"","sources":["../../../../../src/classes/common/MKProgramManager.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,qCAAoC;AAYpC;IASI,0BAAY,YAA6B;QACrC,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACpB,aAAK,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;SACnE;IACL,CAAC;IAKD,gCAAK,GAAL;QACI,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC9B,CAAC;IAMD,gDA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