PageSourceSearch

https://1024cg.com/usr/plugins/DPlayer/plugin/h265.min.v.1.0.6.js?v=2

js 1024cg.com collected 2026-10-05 04:46:19 UTC 18,199 bytes, 315 lines download raw bytes

1(function (_0xf94834, _0x219d5e) {
2    if (typeof exports === 'object' && typeof module !== 'undefined')
3        module['exports'] = _0x219d5e();
4    else {
5        if (typeof define === 'function' && define['amd'])
6            define(_0x219d5e);
7        else
8            _0xf94834['H265'] = _0x219d5e();
9    }
10}(typeof self !== 'undefined' ? self : this, function () {
11    'use strict';
12    const _0x3ca680 = 'video/mp4;\x20codecs=\x22avc1.640028\x22', _0x18c449 = 'application/vnd.apple.mpegurl', _0x1a2926 = [
13            'video/mp4;\x20codecs=\x22hvc1.1.6.L120.90\x22',
14            'video/mp4;\x20codecs=\x22hev1.1.6.L120.90\x22',
15            'video/mp4;\x20codecs=\x22hvc1.2.4.L120.90\x22',
16            'video/mp4;\x20codecs=\x22hev1.2.4.L120.90\x22'
17        ], _0x5388aa = [
18            {
19                'test': /\bquark\b/i,
20                'reason': '夸克浏览器:HEVC\x20解码不稳定,强制降级\x20H.264'
21            },
22            {
23                'test': /\bm?qqbrowser\b/i,
24                'reason': 'QQ\x20浏览器:HEVC\x20解码不稳定,强制降级\x20H.264'
25            }
26        ];
27    function _0x440883(_0x146cb3) {
28        const _0x2cda0d = _0x146cb3 || typeof navigator !== 'undefined' && navigator['userAgent'] || '', _0x16a1ba = _0x5388aa['find'](_0x1e8dfe => _0x1e8dfe['test']['test'](_0x2cda0d));
29        return _0x16a1ba ? _0x16a1ba['reason'] : null;
30    }
31    function _0x36ded3(_0x3ca442) {
32        const _0x18f59e = _0x3ca442 || typeof navigator !== 'undefined' && navigator['userAgent'] || '', _0x48b770 = typeof navigator !== 'undefined' && navigator['maxTouchPoints'] > 0x1, _0x570c27 = /Macintosh/i['test'](_0x18f59e), _0x2e25c6 = /iPad|iPhone|iPod/i['test'](_0x18f59e) || _0x570c27 && _0x48b770, _0x2ab4b8 = /Safari/i['test'](_0x18f59e) && !/Chrome|Chromium|Android|Edg\//i['test'](_0x18f59e);
33        return _0x2e25c6 || _0x570c27 && _0x2ab4b8;
34    }
35    async function _0x2a68c9(_0x4f7907, _0x37833b) {
36        const _0xe9b9ef = _0x37833b || (() => {
37        });
38        if (!_0x4f7907)
39            return null;
40        const _0x17d749 = async _0x3ed394 => (await fetch(_0x3ed394, { 'cache': 'no-store' }))['text']();
41        try {
42            const _0xe1c516 = await _0x17d749(_0x4f7907), _0x293e3c = _0xe1c516['match'](/CODECS="([^"]*)"/i), _0x3c42cf = /#EXT-X-STREAM-INF/i['test'](_0xe1c516) ? _0x43105d(_0xe1c516, _0x4f7907) : [], _0x5319a5 = _0x3c42cf['find'](_0x55ab43 => _0x55ab43['type'] === 'hevc') || _0x3c42cf[0x0] || null, _0x4228e4 = _0x5319a5 ? _0x5319a5['codecs'] : _0x293e3c ? _0x293e3c[0x1] : null, _0x1ed019 = _0x5319a5 ? await _0x17d749(_0x5319a5['url']) : _0xe1c516, _0x4606da = /#EXT-X-MAP/i['test'](_0x1ed019) || /\.m4s|\.mp4/i['test'](_0x1ed019) ? 'fmp4' : /\.ts/i['test'](_0x1ed019) ? 'ts' : 'unknown', _0x29560b = (_0x1ed019['match'](/#EXT-X-VERSION:\s*(\d+)/i) || [])[0x1], _0x2a48d2 = /#EXT-X-MAP/i['test'](_0x1ed019) && !/#EXT-X-I-FRAMES-ONLY/i['test'](_0x1ed019) && Number(_0x29560b || 0x0) < 0x6, _0xd23799 = {
43                    'codecs': _0x4228e4,
44                    'vodFormat': _0x4606da,
45                    'isVersion': _0x2a48d2,
46                    'mainVariants': _0x3c42cf
47                };
48            return _0xe9b9ef({
49                'phase': 'manifest',
50                'ok': !![],
51                'manifest': _0xd23799
52            }), _0xd23799;
53        } catch (_0xe90896) {
54            return console['error']('[player.h265]\x20清单失败', _0xe90896['message']), _0xe9b9ef({
55                'phase': 'manifest',
56                'ok': ![],
57                'reason': _0xe90896['message']
58            }), null;
59        }
60    }
61    async function _0x1b0a9c(_0x199030, _0x3c5b8c) {
62        const _0x38eade = _0x3c5b8c || (() => {
63            }), _0x5cdb0d = _0xf6008a(_0x199030 && _0x199030['codecs']), _0x2dc46e = _0x5cdb0d ? []['concat'](_0x5cdb0d) : _0x1a2926, _0x443745 = document['createElement']('video'), _0xde082a = _0x553518 => _0x443745['canPlayType'](_0x553518) !== '', _0x151b6f = window['ManagedMediaSource'] || window['MediaSource'], _0x553be9 = _0x448330 =>
63 !!(_0x151b6f && _0x151b6f['isTypeSupported'] && _0x151b6f['isTypeSupported'](_0x448330)), _0x4b4950 = _0x2dc46e['find'](_0x3f1d26 => _0xde082a(_0x3f1d26) || _0x553be9(_0x3f1d26)) || _0x2dc46e[0x0], _0x1eba41 = {
64                'nativeHls': _0xde082a(_0x18c449),
65                'nativeAvc': _0xde082a(_0x3ca680),
66                'nativeHevc': _0x2dc46e['some'](_0xde082a),
67                'mseHevc': _0x2dc46e['some'](_0x553be9),
68                'mseAvc': _0x553be9(_0x3ca680),
69                'mse': !!_0x151b6f,
70                'hlsjs': !!(window['Hls'] && window['Hls']['isSupported'] && window['Hls']['isSupported']()),
71                'hevcDeny': _0x440883(),
72                'isApple': _0x36ded3(),
73                'mime': _0x4b4950,
74                'isHardware': null,
75                'isSmooth': null
76            };
77        if (navigator['mediaCapabilities'] && navigator['mediaCapabilities']['decodingInfo'])
78            try {
79                const _0x30d035 = await navigator['mediaCapabilities']['decodingInfo']({
80                    'type': _0x1eba41['nativeHls'] ? 'file' : 'media-source',
81                    'video': {
82                        'contentType': _0x4b4950,
83                        'width': 0x780,
84                        'height': 0x438,
85                        'bitrate': 0x2dc6c0,
86                        'framerate': 0x1e
87                    }
88                });
89                _0x1eba41['isHardware'] = _0x30d035['supported'] ? _0x30d035['powerEfficient'] : ![], _0x1eba41['isSmooth'] = _0x30d035['supported'] ? _0x30d035['smooth'] : ![];
90            } catch (_0x3ff79c) {
91            }
92        return _0x38eade({
93            'phase': 'capabilities',
94            'capables': _0x1eba41,
95            'mime': _0x1eba41['mime']
96        }), _0x1eba41;
97    }
98    function _0xf03e37(_0x5b378f, _0x453d4e, {
99        timeout: timeout = 0x1388
100    } = {}) {
101        const _0x4f39e7 = _0xe68514 => {
102            if (_0xe68514['getVideoPlaybackQuality'])
103                return _0xe68514['getVideoPlaybackQuality']()['totalVideoFrames'];
104            return _0xe68514['webkitDecodedFrameCount'] || 0x0;
105        };
106        return new Promise(_0x3c6afc => {
107            const _0x572efb = document['createElement']('video');
108            _0x572efb['muted'] = !![], _0x572efb['volume'] = 0x0, _0x572efb['playsInline'] = !![], _0x572efb['preload'] = 'auto', _0x572efb['setAttribute']('muted', ''), _0x572efb['setAttribute']('playsinline', ''), _0x572efb['setAttribute']('webkit-playsinline', ''), _0x572efb['setAttribute']('x5-playsinline', ''), _0x572efb['setAttribute']('x5-video-player-type', 'h5-page'), _0x572efb['setAttribute']('x5-video-player-fullscreen', 'false'), _0x572efb['setAttribute']('t7-video-player-type', 'inline'), _0x572efb['setAttribute']('style', 'position:fixed;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none'), document['body']['appendChild'](_0x572efb);
109            let _0x300542 = null, _0x4a4336 = null, _0x5dbaa5 = null, _0x1fd9bc = ![];
110            const _0x2075f8 = () => {
111                    if (_0x4a4336)
112                        clearInterval(_0x4a4336);
113                    if (_0x300542)
114                        try {
115                            _0x300542['destroy']();
116                        } catch (_0x313d4a) {
117                        }
118                    _0x572efb['removeAttribute']('src');
119                    try {
120                        _0x572efb['load']();
121                    } catch (_0xf442d1) {
122                    }
123                    if (_0x572efb['parentNode'])
124                        _0x572efb['parentNode']['removeChild'](_0x572efb);
125                }, _0x1241d1 = (_0x493cd3, _0x1d8c58) => {
126                    if (_0x1fd9bc)
127                        return;
128                    _0x1fd9bc = !![];
129                    const {
130                            videoWidth: _0x3f6d27,
131                            videoHeight: _0x392814
132                        } = _0x572efb, _0x9b4d31 = Date['now']() - _0x1cb4f5;
133                    _0x2075f8(), console['log']('[player.h265]\x20播放探测', _0x1d8c58, _0x3f6d27 + '×' + _0x392814, _0x9b4d31 + 'ms'), _0x3c6afc({
134                        'ok': _0x493cd3,
135                        'reason': _0x1d8c58,
136                        'width': _0x3f6d27,
137                        'height': _0x392814,
138                        'cost': _0x9b4d31
139                    });
140                }, _0x1cb4f5 = Date['now']();
141            _0x4a4336 = setInterval(() => {
142                if (_0x5dbaa5)
143                    return _0x1241d1(![], _0x5dbaa5);
144                if (_0x572efb['error'])
145                    return _0x1241d1(![], 'MediaError\x20code=' + _0x572efb['error']['code']);
146                if (_0x572efb['videoWidth'] > 0x0 && (_0x4f39e7(_0x572efb) > 0x0 || _0x572efb['readyState'] >= 0x3))
147                    return _0x1241d1(!![], '画面解析');
148                if (_0x572efb['currentTime'] > 0x1 && _0x572efb['videoWidth'] === 0x0)
149                    return _0x1241d1(![], '切片异常');
150                Date['now']() - _0x1cb4f5 >
150 timeout && _0x1241d1(![], '切片异常(' + _0x572efb['readyState'] + ')' + timeout / 0x3e8 + 's');
151            }, 0xc8);
152            if (_0x5b378f === 'native') {
153                _0x572efb['src'] = _0x453d4e, _0x572efb['play']()['catch'](() => {
154                });
155                return;
156            }
157            const _0x41523b = window['Hls'];
158            if (!_0x41523b) {
159                _0x5dbaa5 = '缺失HLS';
160                return;
161            }
162            _0x300542 = new _0x41523b({ 'enableWorker': !![] }), _0x300542['on'](_0x41523b['Events']['ERROR'], (_0x43c8b3, _0x6a6b74) => {
163                if (_0x6a6b74['fatal'])
164                    _0x5dbaa5 = 'hls.js\x20' + _0x6a6b74['type'] + '/' + _0x6a6b74['details'];
165            }), _0x300542['on'](_0x41523b['Events']['MANIFEST_PARSED'], () => {
166                _0x572efb['play']()['catch'](() => {
167                });
168            }), _0x300542['loadSource'](_0x453d4e), _0x300542['attachMedia'](_0x572efb);
169        });
170    }
171    function _0x43105d(_0x354b4d, _0x4339d2) {
172        const _0x3eb599 = [];
173        let _0x4b5410 = null;
174        for (const _0x134fd4 of _0x354b4d['split']('\x0a')) {
175            const _0x1ffbc5 = _0x134fd4['trim']();
176            if (/^#EXT-X-STREAM-INF:/i['test'](_0x1ffbc5)) {
177                const _0x5d9cca = _0x1ffbc5['match'](/CODECS="([^"]*)"/i);
178                _0x4b5410 = _0x5d9cca ? _0x5d9cca[0x1] : '';
179                continue;
180            }
181            if (_0x4b5410 === null || !_0x1ffbc5 || _0x1ffbc5['charAt'](0x0) === '#')
182                continue;
183            _0x3eb599['push']({
184                'url': new URL(_0x1ffbc5, _0x4339d2)['href'],
185                'codecs': _0x4b5410,
186                'type': /hvc1|hev1/i['test'](_0x4b5410) ? 'hevc' : /avc1|avc3/i['test'](_0x4b5410) ? 'avc' : 'other'
187            }), _0x4b5410 = null;
188        }
189        return _0x3eb599;
190    }
191    function _0xf6008a(_0x16f705) {
192        if (!_0x16f705)
193            return null;
194        const _0x456f13 = _0x16f705['split'](',')['map'](_0x3cff65 => _0x3cff65['trim']())['find'](_0x115fa4 => /^(hvc1|hev1|avc1|avc3)\./i['test'](_0x115fa4));
195        return _0x456f13 ? 'video/mp4;\x20codecs=\x22' + _0x456f13 + '\x22' : null;
196    }
197    function _0x5b8328(_0x3822b4, _0x4c34a2, _0xe6e60a, _0x450958) {
198        const _0x3479cd = [], _0x5b4791 = _0x4c34a2 && _0x4c34a2['vodFormat'] === 'ts', _0x2a5d5d = !!(_0x4c34a2 && _0x4c34a2['isVersion']), _0x331eb7 = _0x4c34a2 && _0x4c34a2['mainVariants']['find'](_0x4452c5 => _0x4452c5['type'] === 'avc'), _0x596549 = _0x450958 || _0x331eb7 && _0x331eb7['url'] || null, _0x13fc1e = _0x596549 ? _0x3822b4['hevcDeny'] : null, _0x411593 = (_0x1286f5, _0x2d491d, _0x28fce4, _0x27cb15, _0x35d594) => {
199                _0x3479cd['push']({
200                    'tier': _0x1286f5,
201                    'engine': _0x2d491d,
202                    'codec': _0x28fce4,
203                    'url': _0x27cb15,
204                    'status': _0x35d594 ? 'blocked' : 'pending',
205                    'reason': _0x35d594 || null
206                });
207            };
208        _0xe6e60a && (_0x411593('HEVC原生解码', 'native', 'h265', _0xe6e60a, _0x13fc1e ? _0x13fc1e : !_0x3822b4['nativeHls'] ? '浏览器不支持原生HLS' : !_0x3822b4['nativeHevc'] ? '支持原生HLS,但无HEVC解码器' : _0x5b4791 ? 'M3U8非FMP4封装,原生解画面异常' : _0x2a5d5d ? '清单版本非法' : null), _0x411593('HLS转封装解码', 'hlsjs', 'h265', _0xe6e60a, _0x13fc1e ? _0x13fc1e : !_0x3822b4['hlsjs'] ? '引入寄生HLS' : !_0x3822b4['mse'] ? '浏览器无MSE' : !_0x3822b4['mseHevc'] ? '不支持HEVC,\x20缺少硬件解码器' : null));
209        if (_0x596549) {
210            const _0x4b5cd9 = _0x3822b4['nativeHls'], _0x53fa25 = _0x3822b4['hlsjs'] && _0x3822b4['mse'] && _0x3822b4['mseAvc'], _0x3e6b21 = _0x4b5cd9 && _0x3822b4['isApple'] ? [
211                    'native',
212                    'hlsjs'
213                ] : [
214                    'hlsjs',
215                    'native'
216                ];
217            for (const _0x591755 of _0x3e6b21) {
218                _0x591755 === 'native' && _0x4b5cd9 && _0x411593('HLS原生H264è§£ç 
218', 'native', 'h264', _0x596549, null), _0x591755 === 'hlsjs' && _0x53fa25 && _0x411593('HLS.MSE降级H264', 'hlsjs', 'h264', _0x596549, null);
219            }
220            !_0x4b5cd9 && !_0x53fa25 && _0x411593('降级H264', 'native', 'h264', _0x596549, '不支持原生HLS,不支持寄生HLS');
221        }
222        return _0x3479cd;
223    }
224    async function _0x246205({
225        h265: _0x5cc219,
226        h264: _0xcc039d,
227        playerProbe: playerProbe = ![],
228        probeTimeout: _0x8bb57a,
229        onProgress: _0x17a72f
230    } = {}) {
231        console['log']('[player.h265]\x20', {
232            'h265': _0x5cc219,
233            'h264': _0xcc039d,
234            'playerProbe': playerProbe
235        });
236        const _0x5966b7 = _0x17a72f || (() => {
237            }), _0xf28d97 = _0x24651e => {
238                return console['log']('[player.h265]\x20异常结果', _0x24651e), _0x5966b7({
239                    'phase': 'error',
240                    'ok': ![],
241                    'reason': _0x24651e
242                }), {
243                    'codec': null,
244                    'engine': null,
245                    'url': null,
246                    'tier': null,
247                    'hardware': null,
248                    'capables': null,
249                    'manifest': null,
250                    'chains': [],
251                    'error': _0x24651e
252                };
253            };
254        if (!_0x5cc219 && !_0xcc039d)
255            return _0xf28d97('缺少地址h265、h264');
256        try {
257            const _0x613331 = await _0x2a68c9(_0x5cc219, _0x5966b7), _0x27db94 = await _0x1b0a9c(_0x613331, _0x5966b7), _0x323e5f = _0x5b8328(_0x27db94, _0x613331, _0x5cc219, _0xcc039d);
258            console['log']('[player.h265]\x20清单结果', _0x613331), console['log']('[player.h265]\x20能力结果', _0x27db94), console['log']('[player.h265]\x20候链结果', _0x323e5f);
259            const _0x306ca3 = {
260                    'codec': null,
261                    'engine': null,
262                    'url': null,
263                    'tier': null,
264                    'hardware': _0x27db94['isHardware'],
265                    'capables': _0x27db94,
266                    'manifest': _0x613331,
267                    'chains': _0x323e5f
268                }, _0x3fc8b6 = ({
269                    codec: _0x3fc584,
270                    engine: _0x41ff45,
271                    url: _0x29615a,
272                    tier: _0x8df1f7
273                }) => {
274                    Object['assign'](_0x306ca3, {
275                        'codec': _0x3fc584,
276                        'engine': _0x41ff45,
277                        'url': _0x29615a,
278                        'tier': _0x8df1f7
279                    });
280                }, _0xbbac4f = (_0x312c9f, _0x32a86b, _0x2049ff) => {
281                    _0x312c9f['status'] = _0x32a86b, _0x312c9f['reason'] = _0x2049ff, _0x5966b7({
282                        'phase': 'tier',
283                        'resource': _0x312c9f
284                    });
285                };
286            for (const _0x11d59d of _0x323e5f) {
287                if (_0x11d59d['status'] === 'blocked') {
288                    _0x5966b7({
289                        'phase': 'tier',
290                        'resource': _0x11d59d
291                    });
292                    continue;
293                }
294                if (!playerProbe)
295                    return _0xbbac4f(_0x11d59d, 'ok', '判定通过(不做出帧校验)'), _0x3fc8b6(_0x11d59d), console['log']('[player.h265]\x20命中静态', _0x11d59d['tier'], _0x11d59d['engine'], _0x11d59d['url']), _0x306ca3;
296                if (_0x27db94['hevcDeny'])
297                    return _0xbbac4f(_0x11d59d, 'ok', '代理通过(不做出帧校验)'), _0x3fc8b6(_0x11d59d), console['log']('[player.h265]\x20命中静态', _0x11d59d['tier'], _0x11d59d['engine'], _0x11d59d['url']), _0x306ca3;
298                _0xbbac4f(_0x11d59d, 'trying', null);
299                const _0x352091 = await _0xf03e37(_0x11d59d['engine'], _0x11d59d['url'], { 'timeout': _0x8bb57a });
300                if (!_0x352091['ok']) {
301                    _0xbbac4f(_0x11d59d, 'failed', _0x352091['reason'] + '(耗时' + _0x352091['cost'] + 'ms)');
302                    continue;
303                }
304                return _0xbbac4f(_0x11d59d, 'ok', '画面校验\x20' + _0x352091['width'] + '×' + _0x352091['height'] + '(耗时' + _0x352091['cost'] + 'ms)'), _0x3fc8b6(_0x11d59d), console['log']('[player.h265]\x20命中出帧', _0x11d59d['tier'], _0x11d59d['engine'], _0x11d59d['url']), _0x11d59d['codec'] === 'h265' && _0x11d59d['engine'] === 'native' && _0x27db94['isHardware'] === null && (_0x306ca3['hardware'] = !![]), _0x306ca3;
305            }
306            return console['log']('[player.h265]\x20全不可用'), _0x306ca3;
307        } catch (_0x2a9921) {
308            return _0xf28d97(_0x2a9921['message']);
309        }
310    }
311    return {
312        'support': _0x246205,
313        'surveyCapables': _0x1b0a9c
314    };
315}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.