@hyext/builder-revues 0.0.1-beta.11 → 0.0.1-beta.13
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/dist/index.js +208 -151
- package/package.json +7 -6
- package/static/framework/css/index.css +7 -6
- package/static/framework/script/game-adapt.js +6 -6
- package/static/framework/script/game-service.js +10 -10
- package/static/framework/script/service.js +12 -18
- package/static/framework/script/view.js +110 -18
- package/static/template/miniapp-page-manager.hbs +11 -1
- package/static/template/minigame-page-manager.hbs +32 -5
package/dist/index.js
CHANGED
@@ -52,6 +52,52 @@ function initCacheDir() {
|
|
52
52
|
fs__default["default"].mkdirSync(cacheDir);
|
53
53
|
}
|
54
54
|
|
55
|
+
async function compile(projectPath, outputPath) {
|
56
|
+
initCacheDir();
|
57
|
+
await codeCompiler.compilerManager.init({
|
58
|
+
projectPath,
|
59
|
+
outputPath,
|
60
|
+
cachePath: cacheDir
|
61
|
+
});
|
62
|
+
await codeCompiler.compilerManager.compileDev();
|
63
|
+
copyProjectConfigJSON(projectPath, outputPath);
|
64
|
+
}
|
65
|
+
async function compileGame(projectPath, outputPath) {
|
66
|
+
initCacheDir();
|
67
|
+
await codeCompiler.compilerManager.init({
|
68
|
+
projectPath,
|
69
|
+
outputPath,
|
70
|
+
cachePath: cacheDir,
|
71
|
+
compileSettings: {
|
72
|
+
cocos: true
|
73
|
+
}
|
74
|
+
});
|
75
|
+
await codeCompiler.compilerManager.compileDev();
|
76
|
+
copyProjectConfigJSON(projectPath, outputPath);
|
77
|
+
}
|
78
|
+
async function watchGame(projectPath, outputPath, cb) {
|
79
|
+
await compileGame(projectPath, outputPath);
|
80
|
+
codeCompiler.compilerManager.watch('game', async (type, filePath) => {
|
81
|
+
await codeCompiler.compilerManager.compileSingleCode({
|
82
|
+
type,
|
83
|
+
filePath,
|
84
|
+
graphId: 'game'
|
85
|
+
});
|
86
|
+
cb && cb();
|
87
|
+
});
|
88
|
+
}
|
89
|
+
async function watch(projectPath, outputPath, cb) {
|
90
|
+
await compile(projectPath, outputPath);
|
91
|
+
codeCompiler.compilerManager.watch('miniprogram', async (type, filePath) => {
|
92
|
+
await codeCompiler.compilerManager.compileSingleCode({
|
93
|
+
type,
|
94
|
+
filePath,
|
95
|
+
graphId: 'miniprogram'
|
96
|
+
});
|
97
|
+
cb && cb();
|
98
|
+
});
|
99
|
+
}
|
100
|
+
|
55
101
|
const sep = chalk__default["default"].gray('·');
|
56
102
|
const createLogger = (prefix) => {
|
57
103
|
prefix = ` ${prefix}`;
|
@@ -76,47 +122,13 @@ const createLogger = (prefix) => {
|
|
76
122
|
};
|
77
123
|
var logger = createLogger('REVUE');
|
78
124
|
|
79
|
-
// 写成构建插件是最好的,不入侵中间产物,现在图个快
|
80
|
-
function replaceWebAdapter(projectPath) {
|
81
|
-
const sourcePath = path__default["default"].join(projectPath, 'web-adapter.js');
|
82
|
-
const nodePath = require.resolve('@revues/cocos-web-adapter/dist/index.js');
|
83
|
-
if (fs__default["default"].existsSync(sourcePath)) {
|
84
|
-
fs__default["default"].writeFileSync(sourcePath, fs__default["default"].readFileSync(nodePath));
|
85
|
-
}
|
86
|
-
else {
|
87
|
-
logger.log('The web-adapter.js was not found from project root.');
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
async function compile(projectPath, outputPath) {
|
92
|
-
initCacheDir();
|
93
|
-
await codeCompiler.compilerManager.init({
|
94
|
-
projectPath,
|
95
|
-
outputPath,
|
96
|
-
cachePath: cacheDir
|
97
|
-
});
|
98
|
-
await codeCompiler.compilerManager.compileDev();
|
99
|
-
copyProjectConfigJSON(projectPath, outputPath);
|
100
|
-
}
|
101
|
-
async function compileGame(projectPath, outputPath) {
|
102
|
-
initCacheDir();
|
103
|
-
replaceWebAdapter(projectPath);
|
104
|
-
await codeCompiler.compilerManager.init({
|
105
|
-
projectPath,
|
106
|
-
outputPath,
|
107
|
-
cachePath: cacheDir
|
108
|
-
});
|
109
|
-
await codeCompiler.compilerManager.compileDev();
|
110
|
-
copyProjectConfigJSON(projectPath, outputPath);
|
111
|
-
}
|
112
|
-
|
113
125
|
const HOST = {
|
114
126
|
test: '//test-extsdk.msstatic.com',
|
115
127
|
prod: '//extsdk-msstatic.cdn.huya.com'
|
116
128
|
};
|
117
129
|
// $1是动态的extType
|
118
130
|
function getSDKUrlTemplate(opts) {
|
119
|
-
return `${HOST.prod}/sdk/$
|
131
|
+
return `${HOST.prod}/sdk/${opts.extType}/${opts.hostId}/${opts.extUuid || 0}/sdk.js`;
|
120
132
|
}
|
121
133
|
|
122
134
|
function render(content, data, opts) {
|
@@ -155,7 +167,7 @@ function mergeSubPackagesToMainPackage(packagePath, main, subList, onMoveBefore)
|
|
155
167
|
});
|
156
168
|
}
|
157
169
|
|
158
|
-
function mergeMainPackage(releasePath, onMoveBefore) {
|
170
|
+
function mergeMainPackage(watch, releasePath, onMoveBefore) {
|
159
171
|
const packagePath = path__default["default"].join(releasePath, 'package');
|
160
172
|
const packageConfig = getPackageConfig(packagePath);
|
161
173
|
const targetIndex = packageConfig.findIndex(item => {
|
@@ -171,16 +183,21 @@ function mergeMainPackage(releasePath, onMoveBefore) {
|
|
171
183
|
// 合并分包资源到子包
|
172
184
|
mergeSubPackagesToMainPackage(packagePath, mainPakConf, subPakConfList, onMoveBefore);
|
173
185
|
}
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
186
|
+
if (!watch) {
|
187
|
+
const frameworkPath = path__default["default"].join(staticPath, 'framework');
|
188
|
+
// 安置本地框架文件
|
189
|
+
if (deployMode === EDeployMode.Integration) {
|
190
|
+
// 迁移运行框架
|
191
|
+
fs__default["default"].copySync(frameworkPath, path__default["default"].join(releasePath, 'framework'));
|
192
|
+
// 迁移SDK
|
193
|
+
const sdkPath = path__default["default"].join(releasePath, 'sdk');
|
194
|
+
fs__default["default"].mkdirSync(sdkPath);
|
195
|
+
injectNpm(sdkPath, '@revues/web-sdk-core');
|
196
|
+
injectNpm(sdkPath, '@revues/web-frame');
|
197
|
+
injectNpm(sdkPath, '@revues/hyext-adapter');
|
198
|
+
// 这段代码是测试 @revues/js-sdk
|
199
|
+
injectNpm(sdkPath, '@revues/js-sdk');
|
200
|
+
}
|
184
201
|
}
|
185
202
|
return {
|
186
203
|
mainPakConf,
|
@@ -210,71 +227,86 @@ function injectNpm(dest, packageName) {
|
|
210
227
|
// TODO: 改异步
|
211
228
|
// 合并游戏分包到主包
|
212
229
|
function mergeGamePackage(releasePath, opts) {
|
230
|
+
const extUuid = opts.extUuid;
|
231
|
+
const builderConfig = opts.builderConfig;
|
232
|
+
const watch = !!opts.watch;
|
213
233
|
const publicPath = ''; // 留口子,cdn资源路径
|
214
|
-
const { mainPakConf, packagePath } = mergeMainPackage(releasePath);
|
234
|
+
const { mainPakConf, packagePath } = mergeMainPackage(watch, releasePath);
|
215
235
|
const templatePath = path__default["default"].join(staticPath, 'template');
|
216
236
|
const mainPath = path__default["default"].join(packagePath, mainPakConf.name);
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
237
|
+
const entrys = builderConfig.supportExtTypes.map((extType) => {
|
238
|
+
const entryFilename = `index_${extType}.html`;
|
239
|
+
return {
|
240
|
+
extType,
|
241
|
+
entryPath: 'package/' + mainPakConf.name + '/' + entryFilename,
|
242
|
+
sdkUrl: getSDKUrlTemplate({
|
243
|
+
extType,
|
244
|
+
extUuid,
|
245
|
+
hostId: builderConfig.hostId
|
246
|
+
}),
|
247
|
+
entryFilename
|
248
|
+
};
|
228
249
|
});
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
250
|
+
if (!watch) {
|
251
|
+
// 渲染模版
|
252
|
+
renderGameTemplate({
|
253
|
+
entrys,
|
254
|
+
sourcePathPrefix: deployMode === EDeployMode.Integration
|
255
|
+
? path__default["default"].relative(mainPath, releasePath)
|
256
|
+
: publicPath,
|
257
|
+
templatePath,
|
258
|
+
mainPath,
|
259
|
+
...opts.template
|
260
|
+
});
|
261
|
+
// wasn文件 会被 cocos 同步请求,由于二进制文件同步请求失败 所以改为 base64 文本
|
262
|
+
transformWasnFileToBase64File(mainPath);
|
263
|
+
}
|
264
|
+
return entrys;
|
236
265
|
}
|
237
266
|
function renderGameTemplate(opts) {
|
238
|
-
const { mainPath, sourcePathPrefix, templatePath,
|
239
|
-
const
|
240
|
-
|
241
|
-
|
267
|
+
const { mainPath, sourcePathPrefix, templatePath, entrys, debug } = opts;
|
268
|
+
const gameFrameRenderItem = {
|
269
|
+
input: path__default["default"].join(templatePath, 'game-frame.hbs'),
|
270
|
+
output: path__default["default"].join(mainPath, 'game-frame.html'),
|
271
|
+
data: {
|
272
|
+
sourcePathPrefix,
|
273
|
+
}
|
242
274
|
};
|
243
|
-
const
|
244
|
-
{
|
245
|
-
input: path__default["default"].join(templatePath, 'game-frame.hbs'),
|
246
|
-
output: path__default["default"].join(mainPath, 'game-frame.html'),
|
247
|
-
data
|
248
|
-
},
|
249
|
-
{
|
275
|
+
const entryRenderConfList = entrys.map((info) => {
|
276
|
+
return {
|
250
277
|
input: path__default["default"].join(templatePath, 'minigame-page-manager.hbs'),
|
251
|
-
output: path__default["default"].join(mainPath,
|
252
|
-
data
|
253
|
-
|
254
|
-
|
255
|
-
|
278
|
+
output: path__default["default"].join(mainPath, info.entryFilename),
|
279
|
+
data: {
|
280
|
+
sourcePathPrefix,
|
281
|
+
hyextSDKUrl: info.sdkUrl,
|
282
|
+
debug
|
283
|
+
}
|
284
|
+
};
|
285
|
+
});
|
286
|
+
// @ts-ignore
|
287
|
+
entryRenderConfList.concat(gameFrameRenderItem).forEach(config => {
|
256
288
|
renderTemplate(config.input, config.output, config.data);
|
257
289
|
});
|
258
290
|
}
|
259
291
|
const ignorePath = [
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
292
|
+
'node_modules/**/*',
|
293
|
+
'**/node_modules/**',
|
294
|
+
'**/.git/**',
|
295
|
+
'.git/**/*',
|
296
|
+
'**/.svn/**',
|
297
|
+
'.svn/**/*',
|
298
|
+
'.DS_Store',
|
299
|
+
'**/.DS_Store'
|
268
300
|
];
|
269
301
|
function transformWasnFileToBase64File(mainPath) {
|
270
302
|
const files = glob.sync('**/**.wasm', {
|
271
303
|
cwd: mainPath,
|
272
304
|
ignore: ignorePath,
|
273
305
|
nodir: true,
|
274
|
-
absolute: false
|
306
|
+
absolute: false
|
275
307
|
});
|
276
308
|
console.log('transform wasm to base64 files: \n', files);
|
277
|
-
files.forEach(
|
309
|
+
files.forEach(file => {
|
278
310
|
const abs = path__default["default"].join(mainPath, file);
|
279
311
|
const text = fs__default["default"].readFileSync(abs).toString('base64');
|
280
312
|
fs__default["default"].outputFileSync(abs + '.txt', text);
|
@@ -294,50 +326,66 @@ function copyServiceBundleToDest(subRoot, mainRoot, config) {
|
|
294
326
|
}
|
295
327
|
}
|
296
328
|
function mergeMiniprogramPackage(releasePath, opts) {
|
329
|
+
const extUuid = opts.extUuid;
|
330
|
+
const builderConfig = opts.builderConfig;
|
331
|
+
const watch = !!opts.watch;
|
297
332
|
const publicPath = ''; // 留口子,cdn资源路径
|
298
|
-
const { mainPakConf, packagePath } = mergeMainPackage(releasePath, copyServiceBundleToDest);
|
333
|
+
const { mainPakConf, packagePath } = mergeMainPackage(watch, releasePath, copyServiceBundleToDest);
|
299
334
|
const extConfig = getPackageExtConfig(packagePath);
|
300
335
|
const templatePath = path__default["default"].join(staticPath, 'template');
|
301
336
|
const mainPath = path__default["default"].join(packagePath, mainPakConf.name);
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
337
|
+
const entrys = builderConfig.supportExtTypes.map((extType) => {
|
338
|
+
const entryFilename = `index_${extType}.html`;
|
339
|
+
return {
|
340
|
+
extType,
|
341
|
+
entryPath: 'package/' + mainPakConf.name + '/' + entryFilename,
|
342
|
+
sdkUrl: getSDKUrlTemplate({
|
343
|
+
extType,
|
344
|
+
extUuid,
|
345
|
+
hostId: builderConfig.hostId
|
346
|
+
}),
|
347
|
+
entryFilename
|
348
|
+
};
|
314
349
|
});
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
350
|
+
if (!watch) {
|
351
|
+
// 渲染模版
|
352
|
+
renderMiniprogramTemplate({
|
353
|
+
entrys,
|
354
|
+
sourcePathPrefix: deployMode === EDeployMode.Integration
|
355
|
+
? path__default["default"].relative(mainPath, releasePath)
|
356
|
+
: publicPath,
|
357
|
+
packageExtConfig: extConfig,
|
358
|
+
templatePath,
|
359
|
+
mainPath,
|
360
|
+
...opts.template
|
361
|
+
});
|
362
|
+
}
|
363
|
+
return entrys;
|
320
364
|
}
|
321
365
|
function renderMiniprogramTemplate(opts) {
|
322
|
-
const { mainPath, sourcePathPrefix, templatePath,
|
323
|
-
const
|
324
|
-
|
325
|
-
|
326
|
-
|
366
|
+
const { mainPath, sourcePathPrefix, templatePath, entrys, packageExtConfig, debug } = opts;
|
367
|
+
const packageExtConfigStr = JSON.stringify(packageExtConfig);
|
368
|
+
const serviceRenderItem = {
|
369
|
+
input: path__default["default"].join(templatePath, 'service.hbs'),
|
370
|
+
output: path__default["default"].join(mainPath, 'service.html'),
|
371
|
+
data: {
|
372
|
+
sourcePathPrefix,
|
373
|
+
}
|
327
374
|
};
|
328
|
-
const
|
329
|
-
{
|
375
|
+
const entryRenderConfList = entrys.map((info) => {
|
376
|
+
return {
|
330
377
|
input: path__default["default"].join(templatePath, 'miniapp-page-manager.hbs'),
|
331
|
-
output: path__default["default"].join(mainPath,
|
332
|
-
data
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
}
|
339
|
-
|
340
|
-
|
378
|
+
output: path__default["default"].join(mainPath, info.entryFilename),
|
379
|
+
data: {
|
380
|
+
sourcePathPrefix,
|
381
|
+
packageExtConfig: packageExtConfigStr,
|
382
|
+
hyextSDKUrl: info.sdkUrl,
|
383
|
+
debug
|
384
|
+
}
|
385
|
+
};
|
386
|
+
});
|
387
|
+
// @ts-ignore
|
388
|
+
entryRenderConfList.concat(serviceRenderItem).forEach(config => {
|
341
389
|
renderTemplate(config.input, config.output, config.data);
|
342
390
|
});
|
343
391
|
}
|
@@ -387,26 +435,26 @@ function compress(output) {
|
|
387
435
|
}
|
388
436
|
|
389
437
|
async function makeBuildResults(mode, opts) {
|
390
|
-
const { baseURI,
|
438
|
+
const { baseURI, entrys, outputPath } = opts;
|
391
439
|
const releasePath = path__default["default"].join(outputPath, 'build-result');
|
392
440
|
const buildResultMap = {};
|
393
|
-
const buildResultList =
|
441
|
+
const buildResultList = entrys.map(info => {
|
394
442
|
const result = {
|
395
443
|
type: 'HTML',
|
396
444
|
content: {
|
397
445
|
pages: [
|
398
446
|
{
|
399
|
-
path: getPagePath(
|
447
|
+
path: getPagePath(info)
|
400
448
|
}
|
401
449
|
],
|
402
450
|
baseURI
|
403
451
|
}
|
404
452
|
};
|
405
|
-
buildResultMap[
|
453
|
+
buildResultMap[info.extType] = result;
|
406
454
|
return {
|
407
|
-
type,
|
455
|
+
type: info.extType,
|
408
456
|
buildResult: {
|
409
|
-
[
|
457
|
+
[info.extType]: result
|
410
458
|
}
|
411
459
|
};
|
412
460
|
});
|
@@ -418,11 +466,12 @@ async function makeBuildResults(mode, opts) {
|
|
418
466
|
}
|
419
467
|
return buildResultMap;
|
420
468
|
}
|
421
|
-
function getPagePath(
|
422
|
-
|
469
|
+
function getPagePath(entryInfo) {
|
470
|
+
const extType = entryInfo.extType;
|
471
|
+
let entry = entryInfo.entryPath;
|
423
472
|
// 移动端需要补 __module_busi__
|
424
473
|
if (extType.endsWith('_h5')) {
|
425
|
-
entry += '
|
474
|
+
entry += '?__module_busi__=kiwi-ExtSDK';
|
426
475
|
}
|
427
476
|
return entry;
|
428
477
|
}
|
@@ -521,43 +570,51 @@ class RevueBuilder {
|
|
521
570
|
fs__default["default"].existsSync(outputPath) && fs__default["default"].removeSync(outputPath);
|
522
571
|
// 把 inputPath 的文件 迁移到 outputPath
|
523
572
|
await fs__default["default"].copy(inputPath, outputPath, { overwrite: true });
|
524
|
-
const
|
525
|
-
|
526
|
-
extUuid: extUuid
|
573
|
+
const entrys = mergePackage(projectConfig, outputPath, {
|
574
|
+
builderConfig: processedConfig
|
527
575
|
});
|
528
576
|
return await makeBuildResults('production', {
|
529
|
-
|
577
|
+
entrys: entrys,
|
530
578
|
baseURI: publicPath,
|
531
|
-
extTypes: processedConfig.supportExtTypes,
|
532
579
|
outputPath
|
533
580
|
});
|
534
581
|
}
|
535
582
|
async start(opts) {
|
536
|
-
const { inputPath, projectConfig, outputPath: outputPath$1, config } = opts;
|
537
|
-
const outputPath = outputPath$1 || path__default["default"].join(
|
583
|
+
const { debug, inputPath, projectConfig, outputPath: outputPath$1, config } = opts;
|
584
|
+
const outputPath = outputPath$1 || path__default["default"].join(inputPath, 'node_modules', '.revues-project');
|
538
585
|
const processedConfig = processBuilderConfigJSON('development', config);
|
539
586
|
if (projectConfig.compileType == 'game') {
|
540
|
-
await
|
587
|
+
await watchGame(inputPath, outputPath, () => {
|
588
|
+
mergePackage(projectConfig, outputPath, {
|
589
|
+
watch: true,
|
590
|
+
builderConfig: processedConfig
|
591
|
+
});
|
592
|
+
});
|
541
593
|
}
|
542
594
|
else {
|
543
|
-
await
|
595
|
+
await watch(inputPath, outputPath, () => {
|
596
|
+
mergePackage(projectConfig, outputPath, {
|
597
|
+
watch: true,
|
598
|
+
builderConfig: processedConfig
|
599
|
+
});
|
600
|
+
});
|
544
601
|
}
|
545
|
-
const
|
546
|
-
|
547
|
-
|
602
|
+
const entrys = mergePackage(projectConfig, outputPath, {
|
603
|
+
builderConfig: processedConfig,
|
604
|
+
template: {
|
605
|
+
debug
|
606
|
+
}
|
548
607
|
});
|
549
608
|
logger.log('启动 live server 服务...');
|
550
609
|
logger.success('本地访问地址:', getDevBaseURI(processedConfig) +
|
551
|
-
|
552
|
-
'?extType=web_video_com');
|
610
|
+
entrys[0]?.entryPath);
|
553
611
|
startLiveServer({
|
554
612
|
...processedConfig,
|
555
613
|
root: outputPath
|
556
614
|
});
|
557
615
|
return await makeBuildResults('development', {
|
558
|
-
|
616
|
+
entrys,
|
559
617
|
baseURI: getDevBaseURI(processedConfig),
|
560
|
-
extTypes: processedConfig.supportExtTypes,
|
561
618
|
outputPath
|
562
619
|
});
|
563
620
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hyext/builder-revues",
|
3
|
-
"version": "0.0.1-beta.
|
3
|
+
"version": "0.0.1-beta.13",
|
4
4
|
"description": "> TODO: description",
|
5
5
|
"author": "diamondloler <857276958@qq.com>",
|
6
6
|
"homepage": "",
|
@@ -22,10 +22,11 @@
|
|
22
22
|
},
|
23
23
|
"scripts": {},
|
24
24
|
"dependencies": {
|
25
|
-
"@revues/cocos-web-adapter": "0.0.1-beta.
|
26
|
-
"@revues/code-compiler": "0.0.1-beta.
|
27
|
-
"@revues/
|
28
|
-
"@revues/web-
|
25
|
+
"@revues/cocos-web-adapter": "0.0.1-beta.13",
|
26
|
+
"@revues/code-compiler": "0.0.1-beta.13",
|
27
|
+
"@revues/hyext-adapter": "0.0.1-beta.13",
|
28
|
+
"@revues/web-frame": "0.0.1-beta.13",
|
29
|
+
"@revues/web-sdk-core": "0.0.1-beta.13",
|
29
30
|
"archiver": "^7.0.1",
|
30
31
|
"chalk": "^2.4.2",
|
31
32
|
"fs-extra": "8.1.0",
|
@@ -40,5 +41,5 @@
|
|
40
41
|
"@types/live-server": "^1.2.3",
|
41
42
|
"@types/ramda": "^0.29.11"
|
42
43
|
},
|
43
|
-
"gitHead": "
|
44
|
+
"gitHead": "81bcc35d151f138aa3b99138b0bc93c7b855bb9e"
|
44
45
|
}
|
@@ -893,23 +893,23 @@ div.wx-picker {
|
|
893
893
|
position: fixed;
|
894
894
|
width: 100%;
|
895
895
|
left: 0;
|
896
|
-
bottom:
|
896
|
+
bottom: 0;
|
897
897
|
z-index: 2048;
|
898
898
|
-webkit-backface-visibility: hidden;
|
899
899
|
backface-visibility: hidden;
|
900
|
-
-webkit-transform: translateY(100%);
|
900
|
+
/* -webkit-transform: translateY(100%);
|
901
901
|
transform: translateY(100%);
|
902
902
|
-webkit-transition: -webkit-transform .3s;
|
903
903
|
transition: -webkit-transform .3s;
|
904
904
|
transition: transform .3s;
|
905
|
-
transition: transform .3s, -webkit-transform .3s;
|
905
|
+
transition: transform .3s, -webkit-transform .3s; */
|
906
906
|
-moz-user-select: none;
|
907
907
|
-webkit-user-select: none;
|
908
908
|
-ms-user-select: none
|
909
909
|
}
|
910
910
|
|
911
911
|
.wx-picker-android {
|
912
|
-
bottom:
|
912
|
+
bottom: 0px
|
913
913
|
}
|
914
914
|
|
915
915
|
.wx-picker-show {
|
@@ -3113,7 +3113,8 @@ wx-video .wx-video-slot * {
|
|
3113
3113
|
|
3114
3114
|
wx-video video {
|
3115
3115
|
width: 100%;
|
3116
|
-
height: 100
|
3116
|
+
height: 100%;
|
3117
|
+
position: relative;
|
3117
3118
|
}
|
3118
3119
|
|
3119
3120
|
wx-video .wx-video-playmask {
|
@@ -3150,7 +3151,7 @@ wx-video .wx-video-bar {
|
|
3150
3151
|
display: flex;
|
3151
3152
|
-webkit-align-items: center;
|
3152
3153
|
align-items: center;
|
3153
|
-
padding: 0 10px
|
3154
|
+
padding: 0 10px;
|
3154
3155
|
}
|
3155
3156
|
|
3156
3157
|
wx-video .wx-video-bar.full {
|
@@ -8952,12 +8952,12 @@
|
|
8952
8952
|
!window.isIDE &&
|
8953
8953
|
['log', 'warn', 'error', 'info'].forEach(function(e) {
|
8954
8954
|
/** 先打印原生的错误,后面再优化 */
|
8955
|
-
|
8956
|
-
|
8957
|
-
|
8958
|
-
|
8959
|
-
|
8960
|
-
|
8955
|
+
var t = console[e].bind(console)
|
8956
|
+
console[e] = function() {
|
8957
|
+
window.vConsole
|
8958
|
+
? t.apply(void 0, arguments)
|
8959
|
+
: u.push({ method: e, log: arguments })
|
8960
|
+
}
|
8961
8961
|
}),
|
8962
8962
|
document.addEventListener('keydown', function(e) {
|
8963
8963
|
wx.getEventChannel('onGameKeyDown').emit(e)
|
@@ -10225,7 +10225,7 @@ window.__serviceStartTime__ = Date.now()
|
|
10225
10225
|
? arguments[1]
|
10226
10226
|
: window.__path__
|
10227
10227
|
if (
|
10228
|
-
!/(https?|file|wdfile|
|
10228
|
+
!/(https?|file|wdfile|hyfile):/i.test(e) &&
|
10229
10229
|
!/^\s*data:image/.test(e)
|
10230
10230
|
) {
|
10231
10231
|
if ('/' === e.substring(0, 1))
|
@@ -15307,7 +15307,7 @@ window.__serviceStartTime__ = Date.now()
|
|
15307
15307
|
}
|
15308
15308
|
return (
|
15309
15309
|
(t = n ? _r(t) : t),
|
15310
|
-
/^(plugin|
|
15310
|
+
/^(plugin|hyfile|https?):\/\//.test(t) ? t : ar.getRealRoute(e, t)
|
15311
15311
|
)
|
15312
15312
|
},
|
15313
15313
|
getPlatform: function() {
|
@@ -19764,7 +19764,7 @@ window.__serviceStartTime__ = Date.now()
|
|
19764
19764
|
wx.getImageInfo({
|
19765
19765
|
src: e,
|
19766
19766
|
success: function(e) {
|
19767
|
-
;(r.tempSrc = e.path.startsWith('
|
19767
|
+
;(r.tempSrc = e.path.startsWith('hyfile')
|
19768
19768
|
? e.path
|
19769
19769
|
: '/'.concat(e.path)),
|
19770
19770
|
(r.width = e.width),
|
@@ -19918,7 +19918,7 @@ window.__serviceStartTime__ = Date.now()
|
|
19918
19918
|
ue()(this, e),
|
19919
19919
|
t instanceof Ia
|
19920
19920
|
? (this.image = t.tempSrc)
|
19921
|
-
: (/^(
|
19921
|
+
: (/^(hyfile|http|\/)/.test(t)
|
19922
19922
|
? (this.image = t)
|
19923
19923
|
: (this.image = '/' + Pr.getRealRoute(window.__path__, t, !1)),
|
19924
19924
|
Za({
|
@@ -20659,7 +20659,7 @@ window.__serviceStartTime__ = Date.now()
|
|
20659
20659
|
if (t instanceof Ia) arguments[0] = t.tempSrc
|
20660
20660
|
else {
|
20661
20661
|
if ('string' != typeof t) return
|
20662
|
-
;/^(
|
20662
|
+
;/^(hyfile|http|\/)/.test(t) ||
|
20663
20663
|
(arguments[0] = '/' + Pr.getRealRoute(window.__path__, t, !1)),
|
20664
20664
|
Za({
|
20665
20665
|
canvasId: this.canvasId,
|
@@ -21416,7 +21416,7 @@ window.__serviceStartTime__ = Date.now()
|
|
21416
21416
|
t = arguments.length > 1 ? arguments[1] : void 0,
|
21417
21417
|
n = t.windowPath
|
21418
21418
|
if (
|
21419
|
-
!/(https?|file|wdfile|
|
21419
|
+
!/(https?|file|wdfile|hyfile):/i.test(e) &&
|
21420
21420
|
!/^\s*data:image/.test(e)
|
21421
21421
|
)
|
21422
21422
|
if ('/' === e.substring(0, 1))
|
@@ -23421,7 +23421,7 @@ window.__serviceStartTime__ = Date.now()
|
|
23421
23421
|
e,
|
23422
23422
|
"compressImage:fail file doesn't exist"
|
23423
23423
|
)
|
23424
|
-
: ((e.src = /^
|
23424
|
+
: ((e.src = /^hyfile:\/\//.test(e.src)
|
23425
23425
|
? e.src
|
23426
23426
|
: '/'.concat(e.src)),
|
23427
23427
|
Rr.invokeMethod(
|
@@ -23460,7 +23460,7 @@ window.__serviceStartTime__ = Date.now()
|
|
23460
23460
|
}
|
23461
23461
|
)
|
23462
23462
|
} else
|
23463
|
-
/^(wdfile|
|
23463
|
+
/^(wdfile|hyfile):\/\//.test(e.src),
|
23464
23464
|
Rr.invokeMethod('getImageInfo', e, {
|
23465
23465
|
beforeSuccess: function(t) {
|
23466
23466
|
t.path = e.src
|
@@ -25884,7 +25884,7 @@ window.__serviceStartTime__ = Date.now()
|
|
25884
25884
|
if ('' !== e) {
|
25885
25885
|
if ('string' == typeof e) {
|
25886
25886
|
if ((e.startsWith('/') && (e = '.' + e), window.isWebviewGame)) {
|
25887
|
-
if (!/(
|
25887
|
+
if (!/(hyfile|http)/.test(e))
|
25888
25888
|
try {
|
25889
25889
|
wx.getFileSystemManager().accessSync(e)
|
25890
25890
|
} catch (e) {
|
@@ -26369,7 +26369,7 @@ window.__serviceStartTime__ = Date.now()
|
|
26369
26369
|
}
|
26370
26370
|
}
|
26371
26371
|
;(lf.env = {
|
26372
|
-
USER_DATA_PATH: window.__fcjs_user_data_path || '
|
26372
|
+
USER_DATA_PATH: window.__fcjs_user_data_path || 'hyfile://usr'
|
26373
26373
|
}),
|
26374
26374
|
(lf.loadExtApi = function(e) {
|
26375
26375
|
if (e) {
|
@@ -20254,7 +20254,7 @@ window.__serviceStartTime__ = Date.now()
|
|
20254
20254
|
? arguments[1]
|
20255
20255
|
: window.__path__
|
20256
20256
|
if (
|
20257
|
-
!/(https?|file|wdfile|
|
20257
|
+
!/(https?|file|wdfile|hyfile):/i.test(e) &&
|
20258
20258
|
!/^\s*data:image/.test(e)
|
20259
20259
|
) {
|
20260
20260
|
if ('/' === e.substring(0, 1))
|
@@ -22213,12 +22213,8 @@ window.__serviceStartTime__ = Date.now()
|
|
22213
22213
|
console.groupEnd()
|
22214
22214
|
},
|
22215
22215
|
info: function(e) {
|
22216
|
-
|
22217
|
-
|
22218
|
-
// var t = __wxConfig__ && __wxConfig__.debug
|
22219
|
-
// window.isIDE
|
22220
|
-
// ? t && console.info(e)
|
22221
|
-
// : window.__enableDebug && console.info(e)
|
22216
|
+
var debug = __wxConfig__ && __wxConfig__.debug
|
22217
|
+
debug && console.info(e)
|
22222
22218
|
},
|
22223
22219
|
surroundByTryCatch: function(e, t) {
|
22224
22220
|
var n = this
|
@@ -25297,7 +25293,7 @@ window.__serviceStartTime__ = Date.now()
|
|
25297
25293
|
}
|
25298
25294
|
return (
|
25299
25295
|
(t = n ? kr(t) : t),
|
25300
|
-
/^(plugin|
|
25296
|
+
/^(plugin|hyfile|https?):\/\//.test(t) ? t : ir.getRealRoute(e, t)
|
25301
25297
|
)
|
25302
25298
|
},
|
25303
25299
|
getPlatform: function() {
|
@@ -27033,7 +27029,7 @@ window.__serviceStartTime__ = Date.now()
|
|
27033
27029
|
return window.isNewCanvasSupported || !1
|
27034
27030
|
}
|
27035
27031
|
function Oo() {
|
27036
|
-
return window.__fcjs_user_data_path || '
|
27032
|
+
return window.__fcjs_user_data_path || 'hyfile://usr'
|
27037
27033
|
}
|
27038
27034
|
function Po() {
|
27039
27035
|
return window.iosRemoteDebuggerLog
|
@@ -27071,8 +27067,6 @@ window.__serviceStartTime__ = Date.now()
|
|
27071
27067
|
(this.shouldUpdateLocalStorage = !0)
|
27072
27068
|
var n = this
|
27073
27069
|
Lo.forEach(function(e) {
|
27074
|
-
R ||
|
27075
|
-
N ||
|
27076
27070
|
(console[e] && (t.methods[e] = console[e].bind(console)),
|
27077
27071
|
(console[e] = function() {
|
27078
27072
|
var t
|
@@ -27134,7 +27128,7 @@ window.__serviceStartTime__ = Date.now()
|
|
27134
27128
|
'undefined' != typeof __wxConfig__ && __wxConfig__.debug),
|
27135
27129
|
void 0 !== window.__enableDebug &&
|
27136
27130
|
(this.enableDebug = window.__enableDebug),
|
27137
|
-
|
27131
|
+
this.enableDebug
|
27138
27132
|
)
|
27139
27133
|
}
|
27140
27134
|
},
|
@@ -27943,7 +27937,7 @@ window.__serviceStartTime__ = Date.now()
|
|
27943
27937
|
wx.getImageInfo({
|
27944
27938
|
src: e,
|
27945
27939
|
success: function(e) {
|
27946
|
-
;(r.tempSrc = e.path.startsWith('
|
27940
|
+
;(r.tempSrc = e.path.startsWith('hyfile')
|
27947
27941
|
? e.path
|
27948
27942
|
: '/'.concat(e.path)),
|
27949
27943
|
(r.width = e.width),
|
@@ -28102,7 +28096,7 @@ window.__serviceStartTime__ = Date.now()
|
|
28102
28096
|
ce()(this, e),
|
28103
28097
|
t instanceof Ii
|
28104
28098
|
? (this.image = t.tempSrc)
|
28105
|
-
: (/^(
|
28099
|
+
: (/^(hyfile|http|\/)/.test(t)
|
28106
28100
|
? (this.image = t)
|
28107
28101
|
: (this.image = '/' + Ar.getRealRoute(window.__path__, t, !1)),
|
28108
28102
|
Zi({
|
@@ -28843,7 +28837,7 @@ window.__serviceStartTime__ = Date.now()
|
|
28843
28837
|
if (t instanceof Ii) arguments[0] = t.tempSrc
|
28844
28838
|
else {
|
28845
28839
|
if ('string' != typeof t) return
|
28846
|
-
;/^(
|
28840
|
+
;/^(hyfile|http|\/)/.test(t) ||
|
28847
28841
|
(arguments[0] = '/' + Ar.getRealRoute(window.__path__, t, !1)),
|
28848
28842
|
Zi({
|
28849
28843
|
canvasId: this.canvasId,
|
@@ -30073,7 +30067,7 @@ window.__serviceStartTime__ = Date.now()
|
|
30073
30067
|
t = arguments.length > 1 ? arguments[1] : void 0,
|
30074
30068
|
n = t.windowPath
|
30075
30069
|
if (
|
30076
|
-
!/(https?|file|wdfile|
|
30070
|
+
!/(https?|file|wdfile|hyfile):/i.test(e) &&
|
30077
30071
|
!/^\s*data:image/.test(e)
|
30078
30072
|
)
|
30079
30073
|
if ('/' === e.substring(0, 1))
|
@@ -34161,7 +34155,7 @@ window.__serviceStartTime__ = Date.now()
|
|
34161
34155
|
e,
|
34162
34156
|
"compressImage:fail file doesn't exist"
|
34163
34157
|
)
|
34164
|
-
: ((e.src = /^
|
34158
|
+
: ((e.src = /^hyfile:\/\//.test(e.src)
|
34165
34159
|
? e.src
|
34166
34160
|
: '/'.concat(Ar.getRealRoute(us(), e.src, !1))),
|
34167
34161
|
$r.invokeMethod(
|
@@ -34200,7 +34194,7 @@ window.__serviceStartTime__ = Date.now()
|
|
34200
34194
|
}
|
34201
34195
|
)
|
34202
34196
|
} else
|
34203
|
-
/^(wdfile|
|
34197
|
+
/^(wdfile|hyfile):\/\//.test(e.src)
|
34204
34198
|
? $r.invokeMethod('getImageInfo', e, {
|
34205
34199
|
beforeSuccess: function(t) {
|
34206
34200
|
t.path = e.src
|
@@ -52247,10 +52247,10 @@ window.__viewStartTime__ = Date.now()
|
|
52247
52247
|
: ''
|
52248
52248
|
if (
|
52249
52249
|
(e.startsWith('//') && (e = 'https:'.concat(e)),
|
52250
|
-
/(wdfile|
|
52250
|
+
/(wdfile|hyfile):/i.test(e))
|
52251
52251
|
)
|
52252
52252
|
return e.replace(
|
52253
|
-
/(wdfile|
|
52253
|
+
/(wdfile|hyfile):\/\//i,
|
52254
52254
|
'/miniprogram/preview/'
|
52255
52255
|
)
|
52256
52256
|
if (/(https?|file):/i.test(e) || /^\s*data:image/.test(e))
|
@@ -52276,7 +52276,7 @@ window.__viewStartTime__ = Date.now()
|
|
52276
52276
|
? arguments[1]
|
52277
52277
|
: window.__path__
|
52278
52278
|
if (
|
52279
|
-
!/(https?|file|wdfile|
|
52279
|
+
!/(https?|file|wdfile|hyfile):/i.test(t) &&
|
52280
52280
|
!/^\s*data:image/.test(t)
|
52281
52281
|
) {
|
52282
52282
|
if ('/' === t.substring(0, 1))
|
@@ -60027,6 +60027,9 @@ window.__viewStartTime__ = Date.now()
|
|
60027
60027
|
},
|
60028
60028
|
{ capture: !0, passive: !1 }
|
60029
60029
|
),
|
60030
|
+
document.addEventListener('touchstart', (e) => {
|
60031
|
+
// 不加这个ios不触发touch事件
|
60032
|
+
}),
|
60030
60033
|
e.addEventListener(
|
60031
60034
|
'touchstart',
|
60032
60035
|
function(e) {
|
@@ -60630,7 +60633,7 @@ window.__viewStartTime__ = Date.now()
|
|
60630
60633
|
if (
|
60631
60634
|
!/^(http|https):\/\//.test(e) &&
|
60632
60635
|
!/^\s*data:image\//.test(e) &&
|
60633
|
-
(il || !/^
|
60636
|
+
(il || !/^hyfile:\/\//.test(e))
|
60634
60637
|
)
|
60635
60638
|
if (this.ownerShadowRoot) {
|
60636
60639
|
var n = this.ownerShadowRoot.__wxHost.__componentOptions.domain
|
@@ -66484,7 +66487,7 @@ window.__viewStartTime__ = Date.now()
|
|
66484
66487
|
o.removeIntersectionObserver()
|
66485
66488
|
var c = r || i
|
66486
66489
|
if (
|
66487
|
-
(c.indexOf('
|
66490
|
+
(c.indexOf('hyfile://') > -1 &&
|
66488
66491
|
$i &&
|
66489
66492
|
(c += '?t='.concat(v()())),
|
66490
66493
|
(s.src = c),
|
@@ -68982,7 +68985,7 @@ window.__viewStartTime__ = Date.now()
|
|
68982
68985
|
var e =
|
68983
68986
|
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ''
|
68984
68987
|
if (
|
68985
|
-
!/(https?|file|wdfile|
|
68988
|
+
!/(https?|file|wdfile|hyfile):/i.test(e) &&
|
68986
68989
|
!/^\s*data:image/.test(e)
|
68987
68990
|
)
|
68988
68991
|
if ('/' === e.substring(0, 1))
|
@@ -77925,6 +77928,7 @@ window.__viewStartTime__ = Date.now()
|
|
77925
77928
|
},
|
77926
77929
|
attached: function() {
|
77927
77930
|
var e = this
|
77931
|
+
this._addListeners()
|
77928
77932
|
this.duration < 0 && (this.duration = 0),
|
77929
77933
|
FinChatJSBridge.publish('videoPlayerInsertFinish', {
|
77930
77934
|
domId: this.id,
|
@@ -77979,20 +77983,20 @@ window.__viewStartTime__ = Date.now()
|
|
77979
77983
|
t.stopPropagation(), (e.muted = !e.muted)
|
77980
77984
|
}),
|
77981
77985
|
(this.$.button.$$.onclick = function(t) {
|
77982
|
-
t.stopPropagation(), e.$.player[e._buttonType]()
|
77986
|
+
t.stopPropagation(), e.$.player.$$[e._buttonType]()
|
77983
77987
|
}),
|
77984
77988
|
(this.$.progress.$$.onclick = function(t) {
|
77985
77989
|
t.stopPropagation()
|
77986
77990
|
var n = e._computeRate(t.clientX)
|
77987
|
-
;(e.$.player
|
77991
|
+
;(e.$.player.$$.currentTime = e.$.player.$$.duration * n),
|
77988
77992
|
e._resetDanmu()
|
77989
77993
|
}),
|
77990
|
-
(this.$.fullscreen
|
77994
|
+
(this.$.fullscreen.$$.onclick = function(t) {
|
77991
77995
|
t.stopPropagation(),
|
77992
77996
|
'android' === wd.getPlatform()
|
77993
77997
|
? (e.enableFullScreen = !0)
|
77994
77998
|
: (e.enableFullScreen = !e.enableFullScreen),
|
77995
|
-
e.enableFullScreen && e.$.player
|
77999
|
+
e.enableFullScreen && e.$.player.$$.webkitEnterFullscreen(),
|
77996
78000
|
e.triggerEvent('togglefullscreen', {
|
77997
78001
|
enable: e.enableFullScreen
|
77998
78002
|
}),
|
@@ -78002,7 +78006,7 @@ window.__viewStartTime__ = Date.now()
|
|
78002
78006
|
type: 'fullscreen'
|
78003
78007
|
})
|
78004
78008
|
}),
|
78005
|
-
(this.$.danmuBtn
|
78009
|
+
(this.$.danmuBtn.$$.onclick = function(t) {
|
78006
78010
|
t.stopPropagation(),
|
78007
78011
|
(e.enableDanmu = !e.enableDanmu),
|
78008
78012
|
e.triggerEvent('toggledanmu', { enable: e.enableDanmu })
|
@@ -78014,10 +78018,98 @@ window.__viewStartTime__ = Date.now()
|
|
78014
78018
|
}
|
78015
78019
|
),
|
78016
78020
|
wd.onAppEnterBackground(function(t) {
|
78017
|
-
e.$.player
|
78021
|
+
e.$.player.$$.pause()
|
78018
78022
|
})
|
78019
78023
|
},
|
78020
78024
|
methods: {
|
78025
|
+
_addListeners: function() {
|
78026
|
+
var e = this
|
78027
|
+
if (this.$.player) {
|
78028
|
+
for (
|
78029
|
+
var t = this.$.player.$$ || this.$.player,
|
78030
|
+
n = this,
|
78031
|
+
i = {},
|
78032
|
+
o = 0,
|
78033
|
+
r = E()(MediaError);
|
78034
|
+
o < r.length;
|
78035
|
+
o++
|
78036
|
+
) {
|
78037
|
+
var a = r[o]
|
78038
|
+
i[MediaError[a]] = a
|
78039
|
+
}
|
78040
|
+
;(t.onerror = function(e) {
|
78041
|
+
if ((e.stopPropagation(), e.srcElement.error)) {
|
78042
|
+
var t = e.srcElement.error.code
|
78043
|
+
n._publish('error', { errMsg: i[t] })
|
78044
|
+
}
|
78045
|
+
}),
|
78046
|
+
(t.onplaying = function(e) {
|
78047
|
+
;(n.playing = !0),
|
78048
|
+
e.stopPropagation(),
|
78049
|
+
(n._buttonType = 'pause'),
|
78050
|
+
(n.paused = !1)
|
78051
|
+
}),
|
78052
|
+
(t.onwaiting = function(e) {
|
78053
|
+
;(n.playing = !1),
|
78054
|
+
e.stopPropagation(),
|
78055
|
+
n._publish('waiting', {}),
|
78056
|
+
(n._buttonType = 'waiting'),
|
78057
|
+
'function' == typeof n.onWaiting && n.onWaiting(e)
|
78058
|
+
}),
|
78059
|
+
(t.onplay = function(e) {
|
78060
|
+
;(n.playing = !0),
|
78061
|
+
e.stopPropagation(),
|
78062
|
+
n._publish('play', {}),
|
78063
|
+
(n._buttonType = 'pause'),
|
78064
|
+
'function' == typeof n.onPlay && n.onPlay(e),
|
78065
|
+
(n.paused = !1)
|
78066
|
+
}),
|
78067
|
+
(t.onpause = function(e) {
|
78068
|
+
;(n.playing = !1),
|
78069
|
+
e.stopPropagation(),
|
78070
|
+
n._publish('pause', {}),
|
78071
|
+
(n._buttonType = 'play'),
|
78072
|
+
'function' == typeof n.onPause && n.onPause(e),
|
78073
|
+
(n.paused = !0)
|
78074
|
+
}),
|
78075
|
+
(t.onended = function(e) {
|
78076
|
+
;(n.playing = !1),
|
78077
|
+
e.stopPropagation(),
|
78078
|
+
n._publish('ended', {}),
|
78079
|
+
'function' == typeof n.onEnded && n.onEnded(e)
|
78080
|
+
}),
|
78081
|
+
(t.onratechange = function(e) {
|
78082
|
+
e.stopPropagation(),
|
78083
|
+
n._publish('ratechange', { playbackRate: t.playbackRate })
|
78084
|
+
})
|
78085
|
+
var s = 0
|
78086
|
+
t.addEventListener('timeupdate', function(e) {
|
78087
|
+
e.stopPropagation(),
|
78088
|
+
Math.abs(t.currentTime - s) % t.duration >= 1 &&
|
78089
|
+
(n._publish('timeupdate', {
|
78090
|
+
currentTime: t.currentTime,
|
78091
|
+
duration: t.duration
|
78092
|
+
}),
|
78093
|
+
(s = 1e3 * t.currentTime)),
|
78094
|
+
n._isLockTimeUpdateProgress ||
|
78095
|
+
(n._currentTime = n._formatTime(Math.floor(t.currentTime))),
|
78096
|
+
'function' == typeof n.onTimeUpdate && n.onTimeUpdate(e)
|
78097
|
+
}),
|
78098
|
+
t.addEventListener('progress', function(e) {
|
78099
|
+
e.stopPropagation(),
|
78100
|
+
n._publish('progress', {
|
78101
|
+
buffered: (t.currentTime / t.duration) * 100
|
78102
|
+
}),
|
78103
|
+
'function' == typeof n.onProgress && n.onProgress(e)
|
78104
|
+
}),
|
78105
|
+
t.addEventListener('durationchange', function() {
|
78106
|
+
t.duration === 1 / 0 ? (e._isLive = !0) : (e._isLive = !1),
|
78107
|
+
isNaN(t.duration) ||
|
78108
|
+
0 !== e.duration ||
|
78109
|
+
(n._duration = n._formatTime(Math.floor(t.duration)))
|
78110
|
+
})
|
78111
|
+
}
|
78112
|
+
},
|
78021
78113
|
_reset: function() {
|
78022
78114
|
;(this._buttonType = 'play'),
|
78023
78115
|
(this._currentTime = '00:00'),
|
@@ -78158,7 +78250,7 @@ window.__viewStartTime__ = Date.now()
|
|
78158
78250
|
(t.textContent = e.text),
|
78159
78251
|
(t.style.top = this._genDanmuPosition() + '%'),
|
78160
78252
|
(t.style.color = e.color),
|
78161
|
-
this.$.danmu
|
78253
|
+
this.$.danmu.$$.appendChild(t),
|
78162
78254
|
(t.style.left = '-' + t.offsetWidth + 'px')
|
78163
78255
|
}
|
78164
78256
|
},
|
@@ -78213,7 +78305,7 @@ window.__viewStartTime__ = Date.now()
|
|
78213
78305
|
onBallTouchStart: function() {
|
78214
78306
|
var e = 'touchmove',
|
78215
78307
|
t = 'touchend'
|
78216
|
-
if (
|
78308
|
+
if (!this.isLive) {
|
78217
78309
|
var n = this
|
78218
78310
|
n._isLockTimeUpdateProgress = !0
|
78219
78311
|
var i = function(e) {
|
@@ -78222,9 +78314,9 @@ window.__viewStartTime__ = Date.now()
|
|
78222
78314
|
(n._rate = n._computeRate(e.touches[0].clientX)),
|
78223
78315
|
n._setProgress(n._rate)
|
78224
78316
|
}
|
78225
|
-
document.addEventListener(e, i),
|
78317
|
+
document.addEventListener(e, i, { passive: false }),
|
78226
78318
|
document.addEventListener(t, function o(r) {
|
78227
|
-
;(n.$.player
|
78319
|
+
;(n.$.player.$$.currentTime = n.$.player.$$.duration * n._rate),
|
78228
78320
|
document.removeEventListener(e, i),
|
78229
78321
|
document.removeEventListener(t, o),
|
78230
78322
|
(n._isLockTimeUpdateProgress = !1),
|
@@ -78234,7 +78326,7 @@ window.__viewStartTime__ = Date.now()
|
|
78234
78326
|
},
|
78235
78327
|
_resetDanmu: function() {
|
78236
78328
|
var e = this
|
78237
|
-
;(this.$.danmu
|
78329
|
+
;(this.$.danmu.$$.innerHTML = ''),
|
78238
78330
|
E()(this.danmuObject).forEach(function(t) {
|
78239
78331
|
e.danmuObject[t].forEach(function(e) {
|
78240
78332
|
e.flag = !1
|
@@ -81336,7 +81428,7 @@ window.__viewStartTime__ = Date.now()
|
|
81336
81428
|
i.scrollIntoView(),
|
81337
81429
|
t.init()
|
81338
81430
|
}
|
81339
|
-
if (/^
|
81431
|
+
if (/^hyfile:\/\//.test(f)) {
|
81340
81432
|
var N = document.createElement('img')
|
81341
81433
|
N.setAttribute('crossOrigin', 'Anonymous'),
|
81342
81434
|
(N.onload = function() {
|
@@ -49,16 +49,26 @@
|
|
49
49
|
flex-direction: column;
|
50
50
|
margin: 0;
|
51
51
|
padding: 0;
|
52
|
+
}
|
53
|
+
|
54
|
+
* {
|
52
55
|
box-sizing: border-box;
|
53
56
|
}
|
54
57
|
</style>
|
58
|
+
{{#if debug}}
|
59
|
+
<script charset="utf-8" src="https://cdnjs.cloudflare.com/ajax/libs/vConsole/3.15.1/vconsole.min.js"></script>
|
60
|
+
<script>
|
61
|
+
new VConsole()
|
62
|
+
</script>
|
63
|
+
{{/if}}
|
55
64
|
<link rel='stylesheet' href='{{sourcePathPrefix}}/sdk/web-frame.css'>
|
56
65
|
<script charset="utf-8">
|
57
66
|
window.__packageExtConfig = {{ packageExtConfig }}
|
58
|
-
window.__sdkUrlTemplate = "{{hyextSDKUrl}}"
|
59
67
|
</script>
|
60
68
|
<script charset="utf-8" src="{{sourcePathPrefix}}/sdk/web-sdk-core.js"></script>
|
61
69
|
<script charset="utf-8" src="{{sourcePathPrefix}}/sdk/web-frame.js"></script>
|
70
|
+
<script charset="utf-8" src="{{hyextSDKUrl}}"></script>
|
71
|
+
<script charset="utf-8" src="{{sourcePathPrefix}}/sdk/hyext-adapter.js"></script>
|
62
72
|
</head>
|
63
73
|
|
64
74
|
<body>
|
@@ -3,7 +3,8 @@
|
|
3
3
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8" />
|
6
|
-
<meta id="viewport" name="viewport"
|
6
|
+
<meta id="viewport" name="viewport"
|
7
|
+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
|
7
8
|
<meta name="content-type" content="text/html; charset=utf-8">
|
8
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
9
10
|
<style>
|
@@ -17,26 +18,52 @@
|
|
17
18
|
height: 1px;
|
18
19
|
opacity: 0;
|
19
20
|
}
|
21
|
+
|
20
22
|
.views>.webview {
|
21
23
|
position: absolute;
|
22
24
|
width: 100%;
|
23
25
|
height: 100%;
|
24
26
|
}
|
27
|
+
|
25
28
|
.service.service-view {
|
26
29
|
width: 100%;
|
27
30
|
height: 100%;
|
28
31
|
opacity: 1;
|
29
|
-
z-index:
|
32
|
+
z-index: 4;
|
33
|
+
border: none;
|
34
|
+
}
|
35
|
+
|
36
|
+
html,
|
37
|
+
body {
|
38
|
+
position: relative;
|
39
|
+
width: 100%;
|
40
|
+
height: 100%;
|
30
41
|
}
|
42
|
+
|
31
43
|
body {
|
44
|
+
color: #333;
|
45
|
+
display: flex;
|
32
46
|
overscroll-behavior: none;
|
47
|
+
flex-direction: column;
|
48
|
+
margin: 0;
|
49
|
+
padding: 0;
|
50
|
+
}
|
51
|
+
|
52
|
+
* {
|
53
|
+
box-sizing: border-box;
|
33
54
|
}
|
34
55
|
</style>
|
35
|
-
|
36
|
-
|
56
|
+
{{#if debug}}
|
57
|
+
<script charset="utf-8" src="https://cdnjs.cloudflare.com/ajax/libs/vConsole/3.15.1/vconsole.min.js"></script>
|
58
|
+
<script>
|
59
|
+
new VConsole()
|
37
60
|
</script>
|
61
|
+
{{/if}}
|
62
|
+
<link rel='stylesheet' href='{{sourcePathPrefix}}/sdk/web-frame.css'>
|
38
63
|
<script charset="utf-8" src="{{sourcePathPrefix}}/sdk/web-sdk-core.js"></script>
|
39
64
|
<script charset="utf-8" src="{{sourcePathPrefix}}/sdk/web-frame.js"></script>
|
65
|
+
<script charset="utf-8" src="{{hyextSDKUrl}}"></script>
|
66
|
+
<script charset="utf-8" src="{{sourcePathPrefix}}/sdk/hyext-adapter.js"></script>
|
40
67
|
</head>
|
41
68
|
|
42
69
|
<body>
|
@@ -45,4 +72,4 @@
|
|
45
72
|
</div>
|
46
73
|
</body>
|
47
74
|
|
48
|
-
</html>
|
75
|
+
</html>
|