-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathbound.js
182 lines (149 loc) · 478 KB
/
bound.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 15);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * Copyright (C) 2016 Bilibili. All Rights Reserved.\n *\n * @author zheng qian <[email protected]>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable */\n\n\nvar _expGolomb = __webpack_require__(5);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SPSParser = function () {\n function SPSParser() {\n _classCallCheck(this, SPSParser);\n }\n\n _createClass(SPSParser, null, [{\n key: '_ebsp2rbsp',\n value: function _ebsp2rbsp(uint8array) {\n var src = uint8array;\n var src_length = src.byteLength;\n var dst = new Uint8Array(src_length);\n var dst_idx = 0;\n\n for (var i = 0; i < src_length; i++) {\n if (i >= 2) {\n // Unescape: Skip 0x03 after 00 00\n if (src[i] === 0x03 && src[i - 1] === 0x00 && src[i - 2] === 0x00) {\n continue;\n }\n }\n dst[dst_idx] = src[i];\n dst_idx++;\n }\n\n return new Uint8Array(dst.buffer, 0, dst_idx);\n }\n }, {\n key: 'parseSPS',\n value: function parseSPS(uint8array) {\n var rbsp = SPSParser._ebsp2rbsp(uint8array);\n var gb = new _expGolomb2.default(rbsp);\n\n gb.readByte();\n var profile_idc = gb.readByte(); // profile_idc\n gb.readByte(); // constraint_set_flags[5] + reserved_zero[3]\n var level_idc = gb.readByte(); // level_idc\n gb.readUEG(); // seq_parameter_set_id\n\n var profile_string = SPSParser.getProfileString(profile_idc);\n var level_string = SPSParser.getLevelString(level_idc);\n var chroma_format_idc = 1;\n var chroma_format = 420;\n var chroma_format_table = [0, 420, 422, 444];\n var bit_depth = 8;\n\n if (profile_idc === 100 || profile_idc === 110 || profile_idc === 122 || profile_idc === 244 || profile_idc === 44 || profile_idc === 83 || profile_idc === 86 || profile_idc === 118 || profile_idc === 128 || profile_idc === 138 || profile_idc === 144) {\n\n chroma_format_idc = gb.readUEG();\n if (chroma_format_idc === 3) {\n gb.readBits(1); // separate_colour_plane_flag\n }\n if (chroma_format_idc <= 3) {\n chroma_format = chroma_format_table[chroma_format_idc];\n }\n\n bit_depth = gb.readUEG() + 8; // bit_depth_luma_minus8\n gb.readUEG(); // bit_depth_chroma_minus8\n gb.readBits(1); // qpprime_y_zero_transform_bypass_flag\n if (gb.readBool()) {\n // seq_scaling_matrix_present_flag\n var scaling_list_count = chroma_format_idc !== 3 ? 8 : 12;\n for (var i = 0; i < scaling_list_count; i++) {\n if (gb.readBool()) {\n // seq_scaling_list_present_flag\n if (i < 6) {\n SPSParser._skipScalingList(gb, 16);\n } else {\n SPSParser._skipScalingList(gb, 64);\n }\n }\n }\n }\n }\n gb.readUEG(); // log2_max_frame_num_minus4\n var pic_order_cnt_type = gb.readUEG();\n if (pic_order_cnt_type === 0) {\n gb.readUEG(); // log2_max_pic_order_cnt_lsb_minus_4\n } else if (pic_order_cnt_type === 1) {\n gb.readBits(1); // delta_pic_order_always_zero_flag\n gb.readSEG(); // offset_for_non_ref_pic\n gb.readSEG(); // offset_for_top_to_bottom_field\n var num_ref_frames_in_pic_order_cnt_cycle = gb.readUEG();\n for (var _i = 0; _i < num_ref_frames_in_pic_order_cnt_cycle; _i++) {\n gb.readSEG(); // offset_for_ref_frame\n }\n }\n gb.readUEG(); // max_num_ref_frames\n gb.readBits(1); // gaps_in_frame_num_value_allowed_flag\n\n var pic_width_in_mbs_minus1 = gb.readUEG();\n var pic_height_in_map_units_minus1 = gb.readUEG();\n\n var frame_mbs_only_flag = gb.readBits(1);\n if (frame_mbs_only_flag === 0) {\n gb.readBits(1); // mb_adaptive_frame_field_flag\n }\n gb.readBits(1); // direct_8x8_inference_flag\n\n var frame_crop_left_offset = 0;\n var frame_crop_right_offset = 0;\n var frame_crop_top_offset = 0;\n var frame_crop_bottom_offset = 0;\n\n var frame_cropping_flag = gb.readBool();\n if (frame_cropping_flag) {\n frame_crop_left_offset = gb.readUEG();\n frame_crop_right_offset = gb.readUEG();\n frame_crop_top_offset = gb.readUEG();\n frame_crop_bottom_offset = gb.readUEG();\n }\n\n var sar_width = 1,\n sar_height = 1;\n var fps = 0,\n fps_fixed = true,\n fps_num = 0,\n fps_den = 0;\n\n var vui_parameters_present_flag = gb.readBool();\n if (vui_parameters_present_flag) {\n if (gb.readBool()) {\n // aspect_ratio_info_present_flag\n var aspect_ratio_idc = gb.readByte();\n var sar_w_table = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2];\n var sar_h_table = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];\n\n if (aspect_ratio_idc > 0 && aspect_ratio_idc < 16) {\n sar_width = sar_w_table[aspect_ratio_idc - 1];\n sar_height = sar_h_table[aspect_ratio_idc - 1];\n } else if (aspect_ratio_idc === 255) {\n sar_width = gb.readByte() << 8 | gb.readByte();\n sar_height = gb.readByte() << 8 | gb.readByte();\n }\n }\n\n if (gb.readBool()) {\n // overscan_info_present_flag\n gb.readBool(); // overscan_appropriate_flag\n }\n if (gb.readBool()) {\n // video_signal_type_present_flag\n gb.readBits(4); // video_format & video_full_range_flag\n if (gb.readBool()) {\n // colour_description_present_flag\n gb.readBits(24); // colour_primaries & transfer_characteristics & matrix_coefficients\n }\n }\n if (gb.readBool()) {\n // chroma_loc_info_present_flag\n gb.readUEG(); // chroma_sample_loc_type_top_field\n gb.readUEG(); // chroma_sample_loc_type_bottom_field\n }\n if (gb.readBool()) {\n // timing_info_present_flag\n var num_units_in_tick = gb.readBits(32);\n var time_scale = gb.readBits(32);\n fps_fixed = gb.readBool(); // fixed_frame_rate_flag\n\n fps_num = time_scale;\n fps_den = num_units_in_tick * 2;\n fps = fps_num / fps_den;\n }\n }\n\n var sarScale = 1;\n if (sar_width !== 1 || sar_height !== 1) {\n sarScale = sar_width / sar_height;\n }\n\n var crop_unit_x = 0,\n crop_unit_y = 0;\n if (chroma_format_idc === 0) {\n crop_unit_x = 1;\n crop_unit_y = 2 - frame_mbs_only_flag;\n } else {\n var sub_wc = chroma_format_idc === 3 ? 1 : 2;\n var sub_hc = chroma_format_idc === 1 ? 2 : 1;\n crop_unit_x = sub_wc;\n crop_unit_y = sub_hc * (2 - frame_mbs_only_flag);\n }\n\n var codec_width = (pic_width_in_mbs_minus1 + 1) * 16;\n var codec_height = (2 - frame_mbs_only_flag) * ((pic_height_in_map_units_minus1 + 1) * 16);\n\n codec_width -= (frame_crop_left_offset + frame_crop_right_offset) * crop_unit_x;\n codec_height -= (frame_crop_top_offset + frame_crop_bottom_offset) * crop_unit_y;\n\n var present_width = Math.ceil(codec_width * sarScale);\n\n gb.destroy();\n gb = null;\n\n return {\n profile_string: profile_string, // baseline, high, high10, ...\n level_string: level_string, // 3, 3.1, 4, 4.1, 5, 5.1, ...\n bit_depth: bit_depth, // 8bit, 10bit, ...\n chroma_format: chroma_format, // 4:2:0, 4:2:2, ...\n chroma_format_string: SPSParser.getChromaFormatString(chroma_format),\n\n frame_rate: {\n fixed: fps_fixed,\n fps: fps,\n fps_den: fps_den,\n fps_num: fps_num\n },\n\n sar_ratio: {\n width: sar_width,\n height: sar_height\n },\n\n codec_size: {\n width: codec_width,\n height: codec_height\n },\n\n present_size: {\n width: present_width,\n height: codec_height\n }\n };\n }\n }, {\n key: '_skipScalingList',\n value: function _skipScalingList(gb, count) {\n var last_scale = 8,\n next_scale = 8;\n var delta_scale = 0;\n for (var i = 0; i < count; i++) {\n if (next_scale !== 0) {\n delta_scale = gb.readSEG();\n next_scale = (last_scale + delta_scale + 256) % 256;\n }\n last_scale = next_scale === 0 ? last_scale : next_scale;\n }\n }\n }, {\n key: 'getProfileString',\n value: function getProfileString(profile_idc) {\n switch (profile_idc) {\n case 66:\n return 'Baseline';\n case 77:\n return 'Main';\n case 88:\n return 'Extended';\n case 100:\n return 'High';\n case 110:\n return 'High10';\n case 122:\n return 'High422';\n case 244:\n return 'High444';\n default:\n return 'Unknown';\n }\n }\n }, {\n key: 'getLevelString',\n value: function getLevelString(level_idc) {\n return (level_idc / 10).toFixed(1);\n }\n }, {\n key: 'getChromaFormatString',\n value: function getChromaFormatString(chroma) {\n switch (chroma) {\n case 420:\n return '4:2:0';\n case 422:\n return '4:2:2';\n case 444:\n return '4:4:4';\n default:\n return 'Unknown';\n }\n }\n }]);\n\n return SPSParser;\n}();\n\nexports.default = SPSParser;//# sourceMappingURL=data:application/json;charset=utf-8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gICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgU1BTUGFyc2VyLl9za2lwU2NhbGluZ0xpc3QoZ2IsIDY0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBnYi5yZWFkVUVHKCk7IC8vIGxvZzJfbWF4X2ZyYW1lX251bV9taW51czRcbiAgICAgICAgY29uc3QgcGljX29yZGVyX2NudF90eXBlID0gZ2IucmVhZFVFRygpO1xuICAgICAgICBpZiAocGljX29yZGVyX2NudF90eXBlID09PSAwKSB7XG4gICAgICAgICAgICBnYi5yZWFkVUVHKCk7IC8vIGxvZzJfbWF4X3BpY19vcmRlcl9jbnRfbHNiX21pbnVzXzRcbiAgICAgICAgfSBlbHNlIGlmIChwaWNfb3JkZXJfY250X3R5cGUgPT09IDEpIHtcbiAgICAgICAgICAgIGdiLnJlYWRCaXRzKDEpOyAvLyBkZWx0YV9waWNfb3JkZXJfYWx3YXlzX3plcm9fZmxhZ1xuICAgICAgICAgICAgZ2IucmVhZFNFRygpOyAvLyBvZmZzZXRfZm9yX25vbl9yZWZfcGljXG4gICAgICAgICAgICBnYi5yZWFkU0VHKCk7IC8vIG9mZnNldF9mb3JfdG9wX3RvX2JvdHRvbV9maWVsZFxuICAgICAgICAgICAgY29uc3QgbnVtX3JlZl9mcmFtZXNfaW5fcGljX29yZGVyX2NudF9jeWNsZSA9IGdiLnJlYWRVRUcoKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbnVtX3JlZl9mcmFtZXNfaW5fcGljX29yZGVyX2NudF9jeWNsZTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgZ2IucmVhZFNFRygpOyAvLyBvZmZzZXRfZm9yX3JlZl9mcmFtZVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGdiLnJlYW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cHJlc2VudF9mbGFnXG4gICAgICAgICAgICAgICAgZ2IucmVhZFVFRygpOyAvLyBjaHJvbWFfc2FtcGxlX2xvY190eXBlX3RvcF9maWVsZFxuICAgICAgICAgICAgICAgIGdiLnJlYWRVRUcoKTsgLy8gY2hyb21hX3NhbXBsZV9sb2NfdHlwZV9ib3R0b21fZmllbGRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChnYi5yZWFkQm9vbCgpKSB7IC8vIHRpbWluZ19pbmZvX3ByZXNlbnRfZmxhZ1xuICAgICAgICAgICAgICAgIGNvbnN0IG51bV91bml0c19pbl90aWNrID0gZ2IucmVhZEJpdHMoMzIpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHRpbWVfc2NhbGUgPSBnYi5yZWFkQml0cygzMik7XG4gICAgICAgICAgICAgICAgZnBzX2ZpeGVkID0gZ2IucmVhZEJvb2woKTsgLy8gZml4ZWRfZnJhbWVfcmF0ZV9mbGFnXG5cbiAgICAgICAgICAgICAgICBmcHNfbnVtID0gdGltZV9zY2FsZTtcbiAgICAgICAgICAgICAgICBmcHNfZGVuID0gbnVtX3VuaXRzX2luX3RpY2sgKiAyO1xuICAgICAgICAgICAgICAgIGZwcyA9IGZwc19udW0gLyBmcHNfZGVuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHNhclNjYWxlID0gMTtcbiAgICAgICAgaWYgKHNhcl93aWR0aCAhPT0gMSB8fCBzYXJfaGVpZ2h0ICE9PSAxKSB7XG4gICAgICAgICAgICBzYXJTY2FsZSA9IHNhcl93aWR0aCAvIHNhcl9oZWlnaHQ7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgY3JvcF91bml0X3ggPSAwLFxuICAgICAgICAgICAgY3JvcF91bml0X3kgPSAwO1xuICAgICAgICBpZiAoY2hyb21hX2Zvcm1hdF9pZGMgPT09IDApIHtcbiAgICAgICAgICAgIGNyb3BfdW5pdF94ID0gMTtcbiAgICAgICAgICAgI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AgICAgICBsZXZlbF9zdHJpbmcsIC8vIDMsIDMuMSwgNCwgNC4xLCA1LCA1LjEsIC4uLlxuICAgICAgICAgICAgYml0X2RlcHRoLCAvLyA4Yml0LCAxMGJpdCwgLi4uXG4gICAgICAgICAgICBjaHJvbWFfZm9ybWF0LCAvLyA0OjI6MCwgNDoyOjIsIC4uLlxuICAgICAgICAgICAgY2hyb21hX2Zvcm1hdF9zdHJpbmc6IFNQU1BhcnNlci5nZXRDaHJvbWFGb3JtYXRTdHJpbmcoY2hyb21hX2Zvcm1hdCksXG5cbiAgICAgICAgICAgIGZyYW1lX3JhdGU6IHtcbiAgICAgICAgICAgICAgICBmaXhlZDogZnBzX2ZpeGVkLFxuICAgICAgICAgICAgICAgIGZwcyxcbiAgICAgICAgICAgICAgICBmcHNfZGVuLFxuICAgICAgICAgICAgICAgIGZwc19udW1cbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIHNhcl9yYXRpbzoge1xuICAgICAgICAgICAgICAgIHdpZHRoOiBzYXJfd2lkdGgsXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiBzYXJfaGVpZ2h0XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBjb2RlY19zaXplOiB7XG4gICAgICAgICAgICAgICAgd2lkdGg6IGNvZGVjX3dpZHRoLFxuICAgICAgICAgICAgICAgIGhlaWdodDogY29kZWNfaGVpZ2h0XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBwcmVzZW50X3NpemU6IHtcbiAgICAgICAgICAgICAgICB3aWR0aDogcHJlc2VudF93aWR0aCxcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IGNvZGVjX2hlaWdodFxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHN0YXRpYyBfc2tpcFNjYWxpbmdMaXN0KGdiLCBjb3VudCkge1xuICAgICAgICBsZXQgbGFzdF9zY2FsZSA9IDgsXG4gICAgICAgICAgICBuZXh0X3NjYWxlID0gODtcbiAgICAgICAgbGV0IGRlbHRhX3NjYWxlID0gMDtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAobmV4dF9zY2FsZSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGRlbHRhX3NjYWxlID0gZ2IucmVhZFNFRygpO1xuICAgICAgICAgICAgICAgIG5leHRfc2NhbGUgPSAobGFzdF9zY2FsZSArIGRlbHRhX3NjYWxlICsgMjU2KSAlIDI1NjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxhc3Rfc2NhbGUgPSAobmV4dF9zY2FsZSA9PT0gMCkgPyBsYXN0X3NjYWxlIDogbmV4dF9zY2FsZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHN0YXRpYyBnZXRQcm9maWxlU3RyaW5nKHByb2ZpbGVfaWRjKSB7XG4gICAgICAgIHN3aXRjaCAocHJvZmlsZV9pZGMpIHtcbiAgICAgICAgICAgIGNhc2UgNjY6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdCYXNlbGluZSc7XG4gICAgICAgICAgICBjYXNlIDc3OlxuICAgICAgICAgICAgICAgIHJldHVybiAnTWFpbic7XG4gICAgICAgICAgICBjYXNlIDg4OlxuICAgICAgICAgICAgICAgIHJldHVybiAnRXh0ZW5kZWQnO1xuICAgICAgICAgICAgY2FzZSAxMDA6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdIaWdoJztcbiAgICAgICAgICAgIGNhc2UgMTEwOlxuICAgICAgICAgICAgICAgIHJldHVybiAnSGlnaDEwJztcbiAgICAgICAgICAgIGNhc2UgMTIyOlxuICAgICAgICAgICAgICAgIHJldHVybiAnSGlnaDQyMic7XG4gICAgICAgICAgICBjYXNlIDI0NDpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ0hpZ2g0NDQnO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1Vua25vd24nO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc3RhdGljIGdldExldmVsU3RyaW5nKGxldmVsX2lkYykge1xuICAgICAgICByZXR1cm4gKGxldmVsX2lkYyAvIDEwKS50b0ZpeGVkKDEpO1xuICAgIH1cblxuICAgIHN0YXRpYyBnZXRDaHJvbWFGb3JtYXRTdHJpbmcoY2hyb21hKSB7XG4gICAgICAgIHN3aXRjaCAoY2hyb21hKSB7XG4gICAgICAgICAgICBjYXNlIDQyMDpcbiAgICAgICAgICAgICAgICByZXR1cm4gJzQ6MjowJztcbiAgICAgICAgICAgIGNhc2UgNDIyOlxuICAgICAgICAgICAgICAgIHJldHVybiAnNDoyOjInO1xuICAgICAgICAgICAgY2FzZSA0NDQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuICc0OjQ6NCc7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHJldHVybiAnVW5rbm93bic7XG4gICAgICAgIH1cbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgU1BTUGFyc2VyO1xuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2pzL2Zsdi9zcHMtcGFyc2VyLmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable */\n\n\nvar _flvdemux = __webpack_require__(8);\n\nvar _flvdemux2 = _interopRequireDefault(_flvdemux);\n\nvar _mediaInfo = __webpack_require__(9);\n\nvar _mediaInfo2 = _interopRequireDefault(_mediaInfo);\n\nvar _spsParser = __webpack_require__(0);\n\nvar _spsParser2 = _interopRequireDefault(_spsParser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar tagDemux = function () {\n function tagDemux() {\n _classCallCheck(this, tagDemux);\n\n this.TAG = this.constructor.name;\n\n this._config = {};\n\n this._onError = null;\n this._onMediaInfo = null;\n this._onTrackMetadata = null;\n this._onDataAvailable = null;\n\n this._dataOffset = 0;\n this._firstParse = true;\n this._dispatch = false;\n\n this._hasAudio = false;\n this._hasVideo = false;\n\n this._audioInitialMetadataDispatched = false;\n this._videoInitialMetadataDispatched = false;\n\n this._mediaInfo = new _mediaInfo2.default();\n this._mediaInfo.hasAudio = this._hasAudio;\n this._mediaInfo.hasVideo = this._hasVideo;\n this._metadata = null;\n this._audioMetadata = null;\n this._videoMetadata = null;\n\n this._naluLengthSize = 4;\n this._timestampBase = 0; // int32, in milliseconds\n this._timescale = 1000;\n this._duration = 0; // int32, in milliseconds\n this._durationOverrided = false;\n this._referenceFrameRate = {\n fixed: true,\n fps: 23.976,\n fps_num: 23976,\n fps_den: 1000\n };\n\n this._videoTrack = { type: 'video', id: 1, sequenceNumber: 0, addcoefficient: 2, samples: [], length: 0 };\n this._audioTrack = { type: 'audio', id: 2, sequenceNumber: 1, addcoefficient: 2, samples: [], length: 0 };\n\n this._littleEndian = function () {\n var buf = new ArrayBuffer(2);\n new DataView(buf).setInt16(0, 256, true); // little-endian write\n return new Int16Array(buf)[0] === 256; // platform-spec read, if equal then LE\n }();\n }\n\n _createClass(tagDemux, [{\n key: 'onMediaInfo',\n value: function onMediaInfo(callback) {\n this._onMediaInfo = callback;\n }\n }, {\n key: 'parseMetadata',\n value: function parseMetadata(arr) {\n var data = _flvdemux2.default.parseMetadata(arr);\n this._parseScriptData(data);\n console.log(this._mediaInfo, this._mediaInfo.isComplete());\n }\n }, {\n key: '_parseScriptData',\n value: function _parseScriptData(obj) {\n var scriptData = obj;\n\n if (scriptData.hasOwnProperty('onMetaData')) {\n if (this._metadata) {\n console.log(this.TAG, 'Found another onMetaData tag!');\n }\n this._metadata = scriptData;\n var onMetaData = this._metadata.onMetaData;\n\n if (typeof onMetaData.hasAudio === 'boolean') {\n // hasAudio\n this._hasAudio = onMetaData.hasAudio;\n this._mediaInfo.hasAudio = this._hasAudio;\n }\n if (typeof onMetaData.hasVideo === 'boolean') {\n // hasVideo\n this._hasVideo = onMetaData.hasVideo;\n this._mediaInfo.hasVideo = this._hasVideo;\n }\n if (typeof onMetaData.audiodatarate === 'number') {\n // audiodatarate\n this._mediaInfo.audioDataRate = onMetaData.audiodatarate;\n }\n if (typeof onMetaData.videodatarate === 'number') {\n // videodatarate\n this._mediaInfo.videoDataRate = onMetaData.videodatarate;\n }\n if (typeof onMetaData.width === 'number') {\n // width\n this._mediaInfo.width = onMetaData.width;\n }\n if (typeof onMetaData.height === 'number') {\n // height\n this._mediaInfo.height = onMetaData.height;\n }\n if (typeof onMetaData.duration === 'number') {\n // duration\n if (!this._durationOverrided) {\n var duration = Math.floor(onMetaData.duration * this._timescale);\n this._duration = duration;\n this._mediaInfo.duration = duration;\n }\n } else {\n this._mediaInfo.duration = 0;\n }\n if (typeof onMetaData.framerate === 'number') {\n // framerate\n var fps_num = Math.floor(onMetaData.framerate * 1000);\n if (fps_num > 0) {\n var fps = fps_num / 1000;\n this._referenceFrameRate.fixed = true;\n this._referenceFrameRate.fps = fps;\n this._referenceFrameRate.fps_num = fps_num;\n this._referenceFrameRate.fps_den = 1000;\n this._mediaInfo.fps = fps;\n }\n }\n if (_typeof(onMetaData.keyframes) === 'object') {\n // keyframes\n this._mediaInfo.hasKeyframesIndex = true;\n var keyframes = onMetaData.keyframes;\n keyframes.times = onMetaData.times;\n keyframes.filepositions = onMetaData.filepositions;\n this._mediaInfo.keyframesIndex = this._parseKeyframesIndex(keyframes);\n onMetaData.keyframes = null; // keyframes has been extracted, remove it\n } else {\n this._mediaInfo.hasKeyframesIndex = false;\n }\n this._dispatch = false;\n this._mediaInfo.metadata = onMetaData;\n console.log(this.TAG, 'Parsed onMetaData');\n // if (this._mediaInfo.isComplete()) {\n // this._onMediaInfo(this._mediaInfo);\n // }\n return this._mediaInfo;\n }\n }\n }, {\n key: '_parseKeyframesIndex',\n value: function _parseKeyframesIndex(keyframes) {\n var times = [];\n var filepositions = [];\n\n // ignore first keyframe which is actually AVC Sequence Header (AVCDecoderConfigurationRecord)\n for (var i = 1; i < keyframes.times.length; i++) {\n var time = this._timestampBase + Math.floor(keyframes.times[i] * 1000);\n times.push(time);\n filepositions.push(keyframes.filepositions[i]);\n }\n\n return {\n times: times,\n filepositions: filepositions\n };\n }\n\n /**\n * 传入tags输出moof和mdat\n *\n * @param {any} tags\n *\n * @memberof tagDemux\n */\n\n }, {\n key: 'moofTag',\n value: function moofTag(tags) {\n\n for (var i = 0; i < tags.length; i++) {\n this._dispatch = true;\n this.parseChunks(tags[i]);\n // console.log(\"tagTimestamp\", tags[i].getTime(), tags[i]);\n }\n if (this._isInitialMetadataDispatched()) {\n if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {\n this._onDataAvailable(this._audioTrack, this._videoTrack);\n }\n }\n }\n }, {\n key: 'parseChunks',\n value: function parseChunks(flvtag) {\n\n switch (flvtag.tagType) {\n case 8:\n // Audio\n this._parseAudioData(flvtag.body.buffer, 0, flvtag.body.length, flvtag.getTime());\n break;\n case 9:\n // Video\n this._parseVideoData(flvtag.body.buffer, 0, flvtag.body.length, flvtag.getTime(), 0);\n break;\n case 18:\n // ScriptDataObject\n this.parseMetadata(flvtag.body);\n break;\n }\n }\n }, {\n key: '_parseVideoData',\n value: function _parseVideoData(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition) {\n if (tagTimestamp == this._timestampBase && this._timestampBase != 0) {\n console.log(tagTimestamp, this._timestampBase, '夭寿啦这个视频不是从0开始');\n // this.timestampBase(0);\n }\n if (dataSize <= 1) {\n console.log(this.TAG, 'Flv: Invalid video packet, missing VideoData payload!');\n return;\n }\n // 获取 video tag body 第一字节\n var spec = new Uint8Array(arrayBuffer, dataOffset, dataSize)[0];\n // 获取是否是关键帧\n var frameType = (spec & 240) >>> 4;\n // 获取编码格式\n var codecId = spec & 15;\n\n if (codecId !== 7) {\n if (this._onError) this._onError('Flv: Unsupported codec in video frame: ' + codecId);\n return;\n }\n\n this._parseAVCVideoPacket(arrayBuffer, dataOffset + 1, dataSize - 1, tagTimestamp, tagPosition, frameType);\n }\n }, {\n key: '_parseAVCVideoPacket',\n value: function _parseAVCVideoPacket(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType) {\n\n if (dataSize < 4) {\n console.log(this.TAG, 'Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime');\n return;\n }\n\n var le = this._littleEndian;\n // 获取 video tag body 第2字节到结尾\n var v = new DataView(arrayBuffer, dataOffset, dataSize);\n\n // IF CodecID == 7 AVCPacketType\n // 0 = AVC sequence header\n // 1 = AVC NALU\n // 2 = AVC end of sequence (lower level NALU sequence ender is not required or supported)\n var packetType = v.getUint8(0);\n // 3字节\n // IF AVCPacketType == 1\n // Composition time offset\n // ELSE\n // 0\n var cts = v.getUint32(0, !le) & 0x00FFFFFF;\n\n // IF AVCPacketType == 0 AVCDecoderConfigurationRecord(AVC sequence header)\n // IF AVCPacketType == 1 One or more NALUs (Full frames are required)\n\n /**\n *AVCDecoderConfigurationRecord.包含着是H.264解码相关比较重要的sps和pps信息,\n *再给AVC解码器送数据 流之前一定要把sps和pps信息送出,否则的话解码器不能正常解码。\n *而且在解码器stop之后再次start之前,如seek、快进快退状态切换等,\n *都 需要重新送一遍sps和pps的信息.AVCDecoderConfigurationRecord在FLV文件中一般情况也是出现1次,\n *也就是第一个 video tag.\n */\n if (packetType === 0) {\n // AVCDecoderConfigurationRecord\n this._parseAVCDecoderConfigurationRecord(arrayBuffer, dataOffset + 4, dataSize - 4);\n } else if (packetType === 1) {\n // One or more Nalus\n this._parseAVCVideoData(arrayBuffer, dataOffset + 4, dataSize - 4, tagTimestamp, tagPosition, frameType, cts);\n } else if (packetType === 2) {\n // empty, AVC end of sequence\n } else {\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: Invalid video packet type ' + packetType);\n return;\n }\n }\n\n /**\n * AVC 初始化\n */\n\n }, {\n key: '_parseAVCDecoderConfigurationRecord',\n value: function _parseAVCDecoderConfigurationRecord(arrayBuffer, dataOffset, dataSize) {\n if (dataSize < 7) {\n console.log(this.TAG, 'Flv: Invalid AVCDecoderConfigurationRecord, lack of data!');\n return;\n }\n\n var meta = this._videoMetadata;\n var track = this._videoTrack;\n var le = this._littleEndian;\n var v = new DataView(arrayBuffer, dataOffset, dataSize);\n\n if (!meta) {\n meta = this._videoMetadata = {};\n meta.type = 'video';\n meta.id = track.id;\n meta.timescale = this._timescale;\n meta.duration = this._duration;\n } else {\n if (typeof meta.avcc !== 'undefined') {\n console.log(this.TAG, 'Found another AVCDecoderConfigurationRecord!');\n }\n }\n\n var version = v.getUint8(0); // configurationVersion\n var avcProfile = v.getUint8(1); // avcProfileIndication\n var profileCompatibility = v.getUint8(2); // profile_compatibility\n var avcLevel = v.getUint8(3); // AVCLevelIndication\n\n if (version !== 1 || avcProfile === 0) {\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: Invalid AVCDecoderConfigurationRecord');\n return;\n }\n\n this._naluLengthSize = (v.getUint8(4) & 3) + 1; // lengthSizeMinusOne\n if (this._naluLengthSize !== 3 && this._naluLengthSize !== 4) {\n // holy shit!!!\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: Strange NaluLengthSizeMinusOne: ' + (this._naluLengthSize - 1));\n return;\n }\n\n var spsCount = v.getUint8(5) & 31; // numOfSequenceParameterSets\n if (spsCount === 0 || spsCount > 1) {\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: Invalid H264 SPS count: ' + spsCount);\n return;\n }\n\n var offset = 6;\n\n for (var i = 0; i < spsCount; i++) {\n var len = v.getUint16(offset, !le); // sequenceParameterSetLength\n offset += 2;\n\n if (len === 0) {\n continue;\n }\n\n // Notice: Nalu without startcode header (00 00 00 01)\n var sps = new Uint8Array(arrayBuffer, dataOffset + offset, len);\n offset += len;\n\n var config = _spsParser2.default.parseSPS(sps);\n meta.codecWidth = config.codec_size.width;\n meta.codecHeight = config.codec_size.height;\n meta.presentWidth = config.present_size.width;\n meta.presentHeight = config.present_size.height;\n\n meta.profile = config.profile_string;\n meta.level = config.level_string;\n meta.bitDepth = config.bit_depth;\n meta.chromaFormat = config.chroma_format;\n meta.sarRatio = config.sar_ratio;\n meta.frameRate = config.frame_rate;\n\n if (config.frame_rate.fixed === false || config.frame_rate.fps_num === 0 || config.frame_rate.fps_den === 0) {\n meta.frameRate = this._referenceFrameRate;\n }\n\n var fps_den = meta.frameRate.fps_den;\n var fps_num = meta.frameRate.fps_num;\n meta.refSampleDuration = Math.floor(meta.timescale * (fps_den / fps_num));\n\n var codecArray = sps.subarray(1, 4);\n var codecString = 'avc1.';\n for (var j = 0; j < 3; j++) {\n var h = codecArray[j].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n codecString += h;\n }\n meta.codec = codecString;\n\n var mi = this._mediaInfo;\n mi.width = meta.codecWidth;\n mi.height = meta.codecHeight;\n mi.fps = meta.frameRate.fps;\n mi.profile = meta.profile;\n mi.level = meta.level;\n mi.chromaFormat = config.chroma_format_string;\n mi.sarNum = meta.sarRatio.width;\n mi.sarDen = meta.sarRatio.height;\n mi.videoCodec = codecString;\n\n if (mi.hasAudio) {\n if (mi.audioCodec != null) {\n mi.mimeType = 'video/x-flv; codecs=\"' + mi.videoCodec + ',' + mi.audioCodec + '\"';\n }\n } else {\n mi.mimeType = 'video/x-flv; codecs=\"' + mi.videoCodec + '\"';\n }\n if (mi.isComplete()) {\n this._onMediaInfo(mi);\n }\n }\n\n var ppsCount = v.getUint8(offset); // numOfPictureParameterSets\n if (ppsCount === 0 || ppsCount > 1) {\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: Invalid H264 PPS count: ' + ppsCount);\n return;\n }\n\n offset++;\n\n for (var _i = 0; _i < ppsCount; _i++) {\n var _len = v.getUint16(offset, !le); // pictureParameterSetLength\n offset += 2;\n\n if (_len === 0) {\n continue;\n }\n\n // pps is useless for extracting video information\n offset += _len;\n }\n\n meta.avcc = new Uint8Array(dataSize);\n meta.avcc.set(new Uint8Array(arrayBuffer, dataOffset, dataSize), 0);\n console.log(this.TAG, 'Parsed AVCDecoderConfigurationRecord');\n\n if (this._isInitialMetadataDispatched()) {\n // flush parsed frames\n if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {\n this._onDataAvailable(this._audioTrack, this._videoTrack);\n }\n } else {\n this._videoInitialMetadataDispatched = true;\n }\n // notify new metadata\n this._dispatch = false;\n // if (this._onTrackMetadata) {\n // this._onTrackMetadata.call(null, meta);\n // }\n\n this._onTrackMetadata('video', meta);\n }\n }, {\n key: 'timestampBase',\n value: function timestampBase(i) {\n this._timestampBase = i;\n }\n\n /**\n * 普通的AVC 片段\n */\n\n }, {\n key: '_parseAVCVideoData',\n value: function _parseAVCVideoData(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType, cts) {\n\n var le = this._littleEndian;\n var v = new DataView(arrayBuffer, dataOffset, dataSize);\n\n var units = [],\n length = 0;\n\n var offset = 0;\n var lengthSize = this._naluLengthSize;\n var dts = this._timestampBase + tagTimestamp;\n var keyframe = frameType === 1; // from FLV Frame Type constants\n\n while (offset < dataSize) {\n if (offset + 4 >= dataSize) {\n console.log(this.TAG, 'Malformed Nalu near timestamp ' + dts + ', offset = ' + offset + ', dataSize = ' + dataSize);\n break; // data not enough for next Nalu\n }\n // Nalu with length-header (AVC1)\n var naluSize = v.getUint32(offset, !le); // Big-Endian read\n if (lengthSize === 3) {\n naluSize >>>= 8;\n }\n if (naluSize > dataSize - lengthSize) {\n console.log(this.TAG, 'Malformed Nalus near timestamp ' + dts + ', NaluSize > DataSize!');\n return;\n }\n\n var unitType = v.getUint8(offset + lengthSize) & 0x1F;\n\n if (unitType === 5) {\n // IDR\n keyframe = true;\n }\n\n var data = new Uint8Array(arrayBuffer, dataOffset + offset, lengthSize + naluSize);\n var unit = { type: unitType, data: data };\n units.push(unit);\n length += data.byteLength;\n\n offset += lengthSize + naluSize;\n }\n\n if (units.length) {\n var track = this._videoTrack;\n var avcSample = {\n units: units,\n length: length,\n isKeyframe: keyframe,\n dts: dts,\n cts: cts,\n pts: dts + cts\n };\n if (keyframe) {\n avcSample.fileposition = tagPosition;\n }\n track.samples.push(avcSample);\n track.length += length;\n }\n }\n }, {\n key: '_parseAudioData',\n value: function _parseAudioData(arrayBuffer, dataOffset, dataSize, tagTimestamp) {\n if (tagTimestamp == this._timestampBase && this._timestampBase != 0) {\n console.log(tagTimestamp, this._timestampBase, '夭寿啦这个视频不是从0开始');\n // timestampBase(0);\n }\n\n if (dataSize <= 1) {\n console.log(this.TAG, 'Flv: Invalid audio packet, missing SoundData payload!');\n return;\n }\n\n var meta = this._audioMetadata;\n var track = this._audioTrack;\n\n if (!meta || !meta.codec) {\n // initial metadata\n meta = this._audioMetadata = {};\n meta.type = 'audio';\n meta.id = track.id;\n meta.timescale = this._timescale;\n meta.duration = this._duration;\n\n var le = this._littleEndian;\n var v = new DataView(arrayBuffer, dataOffset, dataSize);\n\n var soundSpec = v.getUint8(0);\n\n var soundFormat = soundSpec >>> 4;\n if (soundFormat !== 10) {\n // AAC\n // TODO: support MP3 audio codec\n this._onError(DemuxErrors.CODEC_UNSUPPORTED, 'Flv: Unsupported audio codec idx: ' + soundFormat);\n return;\n }\n\n var soundRate = 0;\n var soundRateIndex = (soundSpec & 12) >>> 2;\n\n var soundRateTable = [5500, 11025, 22050, 44100, 48000];\n\n if (soundRateIndex < soundRateTable.length) {\n soundRate = soundRateTable[soundRateIndex];\n } else {\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: Invalid audio sample rate idx: ' + soundRateIndex);\n return;\n }\n\n var soundSize = (soundSpec & 2) >>> 1; // unused\n var soundType = soundSpec & 1;\n\n meta.audioSampleRate = soundRate;\n meta.channelCount = soundType === 0 ? 1 : 2;\n meta.refSampleDuration = Math.floor(1024 / meta.audioSampleRate * meta.timescale);\n meta.codec = 'mp4a.40.5';\n }\n\n var aacData = this._parseAACAudioData(arrayBuffer, dataOffset + 1, dataSize - 1);\n if (aacData == undefined) {\n return;\n }\n\n if (aacData.packetType === 0) {\n // AAC sequence header (AudioSpecificConfig)\n if (meta.config) {\n console.log(this.TAG, 'Found another AudioSpecificConfig!');\n }\n var misc = aacData.data;\n meta.audioSampleRate = misc.samplingRate;\n meta.channelCount = misc.channelCount;\n meta.codec = misc.codec;\n meta.config = misc.config;\n // The decode result of an aac sample is 1024 PCM samples\n meta.refSampleDuration = Math.floor(1024 / meta.audioSampleRate * meta.timescale);\n console.log(this.TAG, 'Parsed AudioSpecificConfig');\n\n if (this._isInitialMetadataDispatched()) {\n // Non-initial metadata, force dispatch (or flush) parsed frames to remuxer\n if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {\n this._onDataAvailable(this._audioTrack, this._videoTrack);\n }\n } else {\n this._audioInitialMetadataDispatched = true;\n }\n // then notify new metadata\n this._dispatch = false;\n this._onTrackMetadata('audio', meta);\n\n var mi = this._mediaInfo;\n mi.audioCodec = 'mp4a.40.' + misc.originalAudioObjectType;\n mi.audioSampleRate = meta.audioSampleRate;\n mi.audioChannelCount = meta.channelCount;\n if (mi.hasVideo) {\n if (mi.videoCodec != null) {\n mi.mimeType = 'video/x-flv; codecs=\"' + mi.videoCodec + ',' + mi.audioCodec + '\"';\n }\n } else {\n mi.mimeType = 'video/x-flv; codecs=\"' + mi.audioCodec + '\"';\n }\n if (mi.isComplete()) {\n this._onMediaInfo(mi);\n }\n return;\n } else if (aacData.packetType === 1) {\n // AAC raw frame data\n var dts = this._timestampBase + tagTimestamp;\n var aacSample = { unit: aacData.data, dts: dts, pts: dts };\n track.samples.push(aacSample);\n track.length += aacData.data.length;\n } else {\n console.log(this.TAG, 'Flv: Unsupported AAC data type ' + aacData.packetType);\n }\n }\n }, {\n key: '_parseAACAudioData',\n value: function _parseAACAudioData(arrayBuffer, dataOffset, dataSize) {\n if (dataSize <= 1) {\n console.log(this.TAG, 'Flv: Invalid AAC packet, missing AACPacketType or/and Data!');\n return;\n }\n\n var result = {};\n var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);\n\n result.packetType = array[0];\n\n if (array[0] === 0) {\n result.data = this._parseAACAudioSpecificConfig(arrayBuffer, dataOffset + 1, dataSize - 1);\n } else {\n result.data = array.subarray(1);\n }\n\n return result;\n }\n }, {\n key: '_parseAACAudioSpecificConfig',\n value: function _parseAACAudioSpecificConfig(arrayBuffer, dataOffset, dataSize) {\n var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);\n var config = null;\n\n var mpegSamplingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n\n /* Audio Object Type:\n 0: Null\n 1: AAC Main\n 2: AAC LC\n 3: AAC SSR (Scalable Sample Rate)\n 4: AAC LTP (Long Term Prediction)\n 5: HE-AAC / SBR (Spectral Band Replication)\n 6: AAC Scalable\n */\n\n var audioObjectType = 0;\n var originalAudioObjectType = 0;\n var audioExtensionObjectType = null;\n var samplingIndex = 0;\n var extensionSamplingIndex = null;\n // debugger;\n // 5 bits\n audioObjectType = originalAudioObjectType = array[0] >>> 3;\n // 4 bits\n samplingIndex = (array[0] & 0x07) << 1 | array[1] >>> 7;\n if (samplingIndex < 0 || samplingIndex >= mpegSamplingRates.length) {\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: AAC invalid sampling frequency index!');\n return;\n }\n\n var samplingFrequence = mpegSamplingRates[samplingIndex];\n\n // 4 bits\n var channelConfig = (array[1] & 0x78) >>> 3;\n if (channelConfig < 0 || channelConfig >= 8) {\n this._onError(DemuxErrors.FORMAT_ERROR, 'Flv: AAC invalid channel configuration');\n return;\n }\n\n if (audioObjectType === 5) {\n // HE-AAC?\n // 4 bits\n extensionSamplingIndex = (array[1] & 0x07) << 1 | array[2] >>> 7;\n // 5 bits\n audioExtensionObjectType = (array[2] & 0x7C) >>> 2;\n }\n\n // workarounds for various browsers\n var userAgent = self.navigator.userAgent.toLowerCase();\n\n if (userAgent.indexOf('firefox') !== -1) {\n // firefox: use SBR (HE-AAC) if freq less than 24kHz\n if (samplingIndex >= 6) {\n audioObjectType = 5;\n config = new Array(4);\n extensionSamplingIndex = samplingIndex - 3;\n } else {\n // use LC-AAC\n audioObjectType = 2;\n config = new Array(2);\n extensionSamplingIndex = samplingIndex;\n }\n } else if (userAgent.indexOf('android') !== -1) {\n // android: always use LC-AAC\n audioObjectType = 2;\n config = new Array(2);\n extensionSamplingIndex = samplingIndex;\n } else {\n // for other browsers, e.g. chrome...\n // Always use HE-AAC to make it easier to switch aac codec profile\n audioObjectType = 5;\n extensionSamplingIndex = samplingIndex;\n config = new Array(4);\n\n if (samplingIndex >= 6) {\n extensionSamplingIndex = samplingIndex - 3;\n } else if (channelConfig === 1) {\n // Mono channel\n audioObjectType = 2;\n config = new Array(2);\n extensionSamplingIndex = samplingIndex;\n }\n }\n\n config[0] = audioObjectType << 3;\n config[0] |= (samplingIndex & 0x0F) >>> 1;\n config[1] = (samplingIndex & 0x0F) << 7;\n config[1] |= (channelConfig & 0x0F) << 3;\n if (audioObjectType === 5) {\n config[1] |= (extensionSamplingIndex & 0x0F) >>> 1;\n config[2] = (extensionSamplingIndex & 0x01) << 7;\n // extended audio object type: force to 2 (LC-AAC)\n config[2] |= 2 << 2;\n config[3] = 0;\n }\n\n return {\n config: config,\n samplingRate: samplingFrequence,\n channelCount: channelConfig,\n codec: 'mp4a.40.' + audioObjectType,\n originalAudioObjectType: originalAudioObjectType\n };\n }\n }, {\n key: '_isInitialMetadataDispatched',\n value: function _isInitialMetadataDispatched() {\n if (this._hasAudio && this._hasVideo) {\n // both audio & video\n return this._audioInitialMetadataDispatched && this._videoInitialMetadataDispatched;\n }\n if (this._hasAudio && !this._hasVideo) {\n // audio only\n return this._audioInitialMetadataDispatched;\n }\n if (!this._hasAudio && this._hasVideo) {\n // video only\n return this._videoInitialMetadataDispatched;\n }\n }\n }]);\n\n return tagDemux;\n}();\n\nexports.default = new tagDemux();//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9mbHYvdGFnZGVtdXguanM/MTM1YyJdLCJuYW1lcyI6WyJ0YWdEZW11eCIsIlRBRyIsImNvbnN0cnVjdG9yIiwibmFtZSIsIl9jb25maWciLCJfb25FcnJvciIsIl9vbk1lZGlhSW5mbyIsIl9vblRyYWNrTWV0YWRhdGEiLCJfb25EYXRhQXZhaWxhYmxlIiwiX2RhdGFPZmZzZXQiLCJfZmlyc3RQYXJzZSIsIl9kaXNwYXRjaCIsIl9oYXNBdWRpbyIsIl9oYXNWaWRlbyIsIl9hdWRpb0luaXRpYWxNZXRhZGF0YURpc3BhdGNoZWQiLCJfdmlkZW9Jbml0aWFsTWV0YWRhdGFEaXNwYXRjaGVkIiwiX21lZGlhSW5mbyIsImhhc0F1ZGlvIiwiaGFzVmlkZW8iLCJfbWV0YWRhdGEiLCJfYXVkaW9NZXRhZGF0YSIsIl92aWRlb01ldGFkYXRhIiwiX25hbHVMZW5ndGhTaXplIiwiX3RpbWVzdGFtcEJhc2UiLCJfdGltZXNjYWxlIiwiX2R1cmF0aW9uIiwiX2R1cmF0aW9uT3ZlcnJpZGVkIiwiX3JlZmVyZW5jZUZyYW1lUmF0ZSIsIm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A9PT0gJ251bWJlcicpIHsgLy8gYXVkaW9kYXRhcmF0ZVxuICAgICAgICAgICAgICAgIHRoaXMuX21lZGlhSW5mby5hdWRpb0RhdGFSYXRlID0gb25NZXRhRGF0YS5hdWRpb2RhdGFyYXRlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvbk1ldGFEYXRhLnZpZGVvZGF0YXJhdGUgPT09ICdudW1iZXInKSB7IC8vIHZpZGVvZGF0YXJhdGVcbiAgICAgICAgICAgICAgICB0aGlzLl9tZWRpYUluZm8udmlkZW9EYXRhUmF0ZSA9IG9uTWV0YURhdGEudmlkZW9kYXRhcmF0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlb2Ygb25NZXRhRGF0YS53aWR0aCA9PT0gJ251bWJlcicpIHsgLy8gd2lkdGhcbiAgICAgICAgICAgICAgICB0aGlzLl9tZWRpYUluZm8ud2lkdGggPSBvbk1ldGFEYXRhLndpZHRoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvbk1ldGFEYXRhLmhlaWdodCA9PT0gJ251bWJlcicpIHsgLy8gaGVpZ2h0XG4gICAgICAgICAgICAgICAgdGhpcy5fbWVkaWFJbmZvLmhlaWdodCA9IG9uTWV0YURhdGEuaGVpZ2h0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvbk1ldGFEYXRhLmR1cmF0aW9uID09PSAnbnVtYmVyJykgeyAvLyBkdXJhdGlvblxuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fZHVyYXRpb25PdmVycmlkZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZHVyYXRpb24gPSBNYXRoLmZsb29yKG9uTWV0YURhdGEuZHVyYXRpb24gKiB0aGlzLl90aW1lc2NhbGUpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9kdXJhdGlvbiA9IGR1cmF0aW9uO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9tZWRpYUluZm8uZHVyYXRpb24gPSBkdXJhdGlvbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX21lZGlhSW5mby5kdXJhdGlvbiA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9uTWV0YURhdGEuZnJhbWVyYXRlID09PSAnbnVtYmVyJykgeyAvLyBmcmFtZXJhdGVcbiAgICAgICAgICAgICAgICBjb25zdCBmcHNfbnVtID0gTWF0aC5mbG9vcihvbk1ldGFEYXRhLmZyYW1lcmF0ZSAqIDEwMDApO1xuICAgICAgICAgICAgICAgIGlmIChmcHNfbnVtID4gMCkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmcHMgPSBmcHNfbnVtIC8gMTAwMDtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcmVmZXJlbmNlRnJhbWVSYXRlLmZpeGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcmVmZXJlbmNlRnJhbWVSYXRlLmZwcyA9IGZwcztcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcmVmZXJlbmNlRnJhbWVSYXRlLmZwc19udW0gPSBmcHNfbnVtO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9yZWZlcmVuY2VGcmFtZVJhdGUuZnBzX2RlbiA9IDEwMDA7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21lZGlhSW5mby5mcHMgPSBmcHM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvbk1ldGFEYXRhLmtleWZyYW1lcyA9PT0gJ29iamVjdCcpIHsgLy8ga2V5ZnJhbWVzXG4gICAgICAgICAgICAgICAgdGhpcy5fbWVkaWFJbmZvLmhhc0tleWZyYW1lc0luZGV4ID0gdHJ1ZTtcbiAgICAgICAgICA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SLCBgRmx2OiBJbnZhbGlkIEgyNjQgU1BTIGNvdW50OiAke3Nwc0NvdW50fWApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IG9mZnNldCA9IDY7XG5cbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzcHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCBsZW4gPSB2LmdldFVpbnQxNihvZmZzZXQsICFsZSk7IC8vIHNlcXVlbmNlUGFyYW1ldGVyU2V0TGVuZ3RoXG4gICAgICAgICAgICBvZmZzZXQgKz0gMjtcblxuICAgICAgICAgICAgaWYgKGxlbiA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBOb3RpY2U6IE5hbHUgd2l0aG91dCBzdGFydGNvZGUgaGVhZGVyICgwMCAwMCAwMCAwMSlcbiAgICAgICAgICAgIGNvbnN0IHNwcyA9IG5ldyBVaW50OEFycmF5KGFycmF5QnVmZmVyLCBkYXRhT2Zmc2V0ICsgb2Zmc2V0LCBsZW4pO1xuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbjtcblxuICAgICAgICAgICAgY29uc3QgY29uZmlnID0gU1BTUGFyc2VyLnBhcnNlU1BTKHNwcyk7XG4gICAgICAgICAgICBtZXRhLmNvZGVjV2lkdGggPSBjb25maWcuY29kZWNfc2l6ZS53aWR0aDtcbiAgICAgICAgICAgIG1ldGEuY29kZWNIZWlnaHQgPSBjb25maWcuY29kZWNfc2l6ZS5oZWlnaHQ7XG4gICAgICAgICAgICBtZXRhLnByZXNlbnRXaWR0aCA9IGNvbmZpZy5wcmVzZW50X3NpemUud2lkdGg7XG4gICAgICAgICAgICBtZXRhLnByZXNlbnRIZWlnaHQgPSBjb25maWcucHJlc2VudF9zaXplLmhlaWdodDtcblxuICAgICAgICAgICAgbWV0YS5wcm9maWxlID0gY29uZmlnLnByb2ZpbGVfc3RyaW5nO1xuICAgICAgICAgICAgbWV0YS5sZXZlbCA9IGNvbmZpZy5sZXZlbF9zdHJpbmc7XG4gICAgICAgICAgICBtZXRhLmJpdERlcHRoID0gY29uZmlnLmJpdF9kZXB0aDtcbiAgICAgICAgICAgIG1ldGEuY2hyb21hRm9ybWF0ID0gY29uZmlnLmNocm9tYV9mb3JtYXQ7XG4gICAgICAgICAgICBtZXRhLnNhclJhdGlvID0gY29uZmlnLnNhcl9yYXRpbztcbiAgICAgICAgICAgIG1ldGEuZnJhbWVSYXRlID0gY29uZmlnLmZyYW1lX3JhdGU7XG5cbiAgICAgICAgICAgIGlmIChjb25maWcuZnJhbWVfcmF0ZS5maXhlZCA9PT0gZmFsc2UgfHxcbiAgICAgICAgICAgICAgICBjb25maWcuZnJhbWVfcmF0ZS5mcHNfbnVtID09PSAwIHx8XG4gICAgICAgICAgICAgICAgY29uZmlnLmZyYW1lX3JhdGUuZnBzX2RlbiA9PT0gMCkge1xuICAgICAgICAgICAgICAgIG1ldGEuZnJhbWVSYXRlID0gdGhpcy5fcmVmZXJlbmNlRnJhbWVSYXRlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBmcHNfZGVuID0gbWV0YS5mcmFtZVJhdGUuZnBzX2RlbjtcbiAgICAgICAgICAgIGNvbnN0IGZwc19udW0gPSBtZXRhLmZyYW1lUmF0ZS5mcHNfbnVtO1xuICAgICAgICAgICAgbWV0YS5yZWZTYW1wbGVEdXJhdGlvbiA9IE1hdGguZmxvb3IobWV0YS50aW1lc2NhbGUgKiAoZnBzX2RlbiAvIGZwc19udW0pKTtcblxuICAgICAgICAgICAgY29uc3QgY29kZWNBcnJheSA9IHNwcy5zdWJhcnJheSgxLCA0KTtcbiAgICAgICAgICAgIGxldCBjb2RlY1N0cmluZyA9ICdhdmMxLic7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IDM7IGorKykge1xuICAgICAgICAgICAgICAgIGxldCBoID0gY29kZWNBcnJheVtqXS50b1N0cmluZygxNik7XG4gICAgICAgICAgICAgICAgaWYgKGgubGVuZ3RoIDwgMikge1xuICAgICAgICAgICAgICAgICAgICBoID0gJzAnICsgaDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29kZWNTdHJpbmcgKz0gaDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG1ldGEuY29kZWMgPSBjb2RlY1N0cmluZztcblxuICAgICAgICAgICAgY29uc3QgbWkgPSB0aGlzLl9tZWRpYUluZm87XG4gICAgICAgICAgICBtaS53aWR0aCA9IG1ldGEuY29kZWNXaWR0aDtcbiAgICAgICAgICAgIG1pLmhlaWdodCA9IG1ldGEuY29kZWNIZWlnaHQ7XG4gICAgICAgICAgICBtaS5mcHMgPSBtZXRhLmZyYW1lUmF0ZS5mcHM7XG4gICAgICAgICAgICBtaS5wcm9maWxlID0gbWV0YS5wcm9maWxlO1xuICAgICAgICAgICAgbWkubGV2ZWwgPSBtZXRhLmxldmVsO1xuICAgICAgICAgICAgbWkuY2hyb21hRm9ybWF0ID0gY29uZmlnLmNocm9tYV9mb3JtYXRfc3RyaW5nO1xuICAgICAgICAgICAgbWkuc2FyTnVtID0gbWV0YS5zYXJSYXRpby53aWR0aDtcbiAgICAgICAgICAgIG1pLnNhckRlbiA9IG1ldGEuc2FyUmF0aW8uaGVpZ2h0O1xuICAgICAgICAgICAgbWkudmlkZW9Db2RlYyA9IGNvZGVjU3RyaW5nO1xuXG4gICAgICAgICAgICBpZiAobWkuaGFzQXVkaW8pIHtcbiAgICAgICAgICAgICAgICBpZiAobWkuYXVkaW9Db2RlYyAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIG1pLm1pbWVUeXBlID0gJ3ZpZGVvL3gtZmx2OyBjb2RlY3M9XCInICsgbWkudmlkZW9Db2RlYyArICcsJyArIG1pLmF1ZGlvQ29kZWMgKyAnXCInO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWkubWltZVR5cGUgPSAndmlkZW8veC1mbHY7IGNvZGVjcz1cIicgKyBtaS52aWRlb0NvZGVjICsgJ1wiJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtaS5pc0NvbXBsZXRlKCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9vbk1lZGlhSW5mbyhtaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwcHNDb3VudCA9IHYuZ2V0VWludDgob2Zmc2V0KTsgLy8gbnVtT2ZQaWN0dXJlUGFyYW1ldGVyU2V0c1xuICAgICAgICBpZiAocHBzQ291bnQgPT09IDAgfHwgcHBzQ291bnQgPiAxKSB7XG4gICAgICAgICAgICB0aGlzLl9vbkVycm9yKERlbXV4RXJyb3JzLkZPUk1BVF9FUlJPUiwgYEZsdjogSW52YWxpZCBIMjY0IFBQUyBjb3VudDogJHtwcHNDb3VudH1gKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIG9mZnNldCsrO1xuXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcHBzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgY29uc3QgbGVuID0gdi5nZXRVaW50MTYob2Zmc2V0LCAhbGUpOyAvLyBwaWN0dXJlUGFyYW1ldGVyU2V0TGVuZ3RoXG4gICAgICAgICAgICBvZmZzZXQgKz0gMjtcblxuICAgICAgICAgICAgaWYgKGxlbiA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBwcHMgaXMgdXNlbGVzcyBmb3IgZXh0cmFjdGluZyB2aWRlbyBpbmZvcm1hdGlvblxuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbjtcbiAgICAgICAgfVxuXG4gICAgICAgIG1ldGEuYXZjYyA9IG5ldyBVaW50OEFycmF5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G4gICAgICAgICAgICBsZXQgbmFsdVNpemUgPSB2LmdldFVpbnQzMihvZmZzZXQsICFsZSk7IC8vIEJpZy1FbmRpYW4gcmVhZFxuICAgICAgICAgICAgaWYgKGxlbmd0aFNpemUgPT09IDMpIHtcbiAgICAgICAgICAgICAgICBuYWx1U2l6ZSA+Pj49IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobmFsdVNpemUgPiBkYXRhU2l6ZSAtIGxlbmd0aFNpemUpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyh0aGlzLlRBRywgYE1hbGZvcm1lZCBOYWx1cyBuZWFyIHRpbWVzdGFtcCAke2R0c30sIE5hbHVTaXplID4gRGF0YVNpemUhYCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCB1bml0VHlwZSA9IHYuZ2V0VWludDgob2Zmc2V0ICsgbGVuZ3RoU2l6ZSkgJiAweDFGO1xuXG4gICAgICAgICAgICBpZiAodW5pdFR5cGUgPT09IDUpIHsgLy8gSURSXG4gICAgICAgICAgICAgICAga2V5ZnJhbWUgPSB0cnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBkYXRhID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlCdWZmZXIsIGRhdGFPZmZzZXQgKyBvZmZzZXQsIGxlbmd0aFNpemUgKyBuYWx1U2l6ZSk7XG4gICAgICAgICAgICBjb25zdCB1bml0ID0geyB0eXBlOiB1bml0VHlwZSwgZGF0YSB9O1xuICAgICAgICAgICAgdW5pdHMucHVzaCh1bml0KTtcbiAgICAgICAgICAgIGxlbmd0aCArPSBkYXRhLmJ5dGVMZW5ndGg7XG5cbiAgICAgICAgICAgIG9mZnNldCArPSBsZW5ndGhTaXplICsgbmFsdVNpemU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodW5pdHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBjb25zdC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G4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsZXQgc291bmRSYXRlID0gMDtcbiAgICAgICAgICAgIGNvbnN0IHNvdW5kUmF0ZUluZGV4ID0gKHNvdW5kU3BlYyAmIDEyKSA+Pj4gMjtcblxuICAgICAgICAgICAgY29uc3Qgc291bmRSYXRlVGFibGUgPSBbNTUwMCwgMTEwMjUsIDIyMDUwLCA0NDEwMCwgNDgwMDBdO1xuXG4gICAgICAgICAgICBpZiAoc291bmRSYXRlSW5kZXggPCBzb3VuZFJhdGVUYWJsZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzb3VuZFJhdGUgPSBzb3VuZFJhdGVUYWJsZVtzb3VuZFJhdGVJbmRleF07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX29uRXJyb3IoRGVtdXhFcnJvcnMuRk9STUFUX0VSUk9SLCAnRmx2OiBJbnZhbGlkIGF1ZGlvIHNhbXBsZSByYXRlIGlkeDogJyArIHNvdW5kUmF0ZUluZGV4KTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IHNvdW5kU2l6ZSA9IChzb3VuZFNwZWMgJiAyKSA+Pj4gMTsgLy8gdW51c2VkXG4gICAgICAgICAgICBjb25zdCBzb3VuZFR5cGUgPSAoc291bmRTcGVjICYgMSk7XG5cbiAgICAgICAgICAgIG1ldGEuYXVkaW9TYW1wbGVSYXRlID0gc291bmRSYXRlO1xuICAgICAgICAgICAgbWV0YS5jaGFubmVsQ291bnQgPSAoc291bmRUeXBlID09PSAwID8gMSA6IDIpO1xuICAgICAgICAgICAgbWV0YS5yZWZTYW1wbGVEdXJhdGlvbiA9IE1hdGguZmxvb3IoMTAyNCAvIG1ldGEuYXVkaW9TYW1wbGVSYXRlICogbWV0YS50aW1lc2NhbGUpO1xuICAgICAgICAgICAgbWV0YS5jb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udDtcbiAgICAgICAgICAgIGlmIChtaS5oYXNWaWRlbykge1xuICAgICAgICAgICAgICAgIGlmIChtaS52aWRlb0NvZGVjICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgbWkubWltZVR5cGUgPSAndmlkZW8veC1mbHY7IGNvZGVjcz1cIicgKyBtaS52aWRlb0NvZGVjICsgJywnICsgbWkuYXVkaW9Db2RlYyArICdcIic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBtaS5taW1lVHlwZSA9ICd2aWRlby94LWZsdjsgY29kZWNzPVwiJyArIG1pLmF1ZGlvQ29kZWMgKyAnXCInO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1pLmlzQ29tcGxldGUoKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX29uTWVkaWFJbmZvKG1pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfSBlbHNlIGlmIChhYWNEYXRhLnBhY2tldFR5cGUgPT09IDEpIHsgLy8gQUFDIHJhdyBmcmFtZSBkYXRhXG4gICAgICAgICAgICBjb25zdCBkdHMgPSB0aGlzLl90aW1lc3RhbXBCYXNlICsgdGFnVGltZXN0YW1wO1xuICAgICAgICAgICAgY29uc3QgYWFjU2FtcGxlID0geyB1bml0OiBhYWNEYXRhLmRhdGEsIGR0cywgcHRzOiBkdHMgfTtcbiAgICAgICAgICAgIHRyYWNrLnNhbXBsZXMucHVzaChhYWNTYW1wbGUpO1xuICAgICAgICAgICAgdHJhY2subGVuZ3RoICs9IGFhY0RhdGEuZGF0YS5sZW5ndGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25zb2xlLmxvZyh0aGlzLlRBRywgYEZsdjogVW5zdXBwb3J0ZWQgQUFDIGRhdGEgdHlwZSAke2FhY0RhdGEucGFja2V0VHlwZX1gKTtcbiAgICAgICAgfVxuICAgIH1cblxu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AgICAgICAgY29uc3QgdXNlckFnZW50ID0gc2VsZi5uYXZpZ2F0b3IudXNlckFnZW50LnRvTG93ZXJDYXNlKCk7XG5cbiAgICAgICAgaWYgKHVzZXJBZ2VudC5pbmRleE9mKCdmaXJlZm94JykgIT09IC0xKSB7XG4gICAgICAgICAgICAvLyBmaXJlZm94OiB1c2UgU0JSIChIRS1BQUMpIGlmIGZyZXEgbGVzcyB0aGFuIDI0a0h6XG4gICAgICAgICAgICBpZiAoc2FtcGxpbmdJbmRleCA+PSA2KSB7XG4gICAgICAgICAgICAgICAgYXVkaW9PYmplY3RUeXBlID0gNTtcbiAgICAgICAgICAgICAgICBjb25maWcgPSBuZXcgQXJyYXkoNCk7XG4gICAgICAgICAgICAgICAgZXh0ZW5zaW9uU2FtcGxpbmdJbmRleCA9IHNhbXBsaW5nSW5kZXggLSAzO1xuICAgICAgICAgICAgfSBlbHNlIHsgLy8gdXNlIExDLUFBQ1xuICAgICAgICAgICAgICAgIGF1ZGlvT2JqZWN0VHlwZSA9IDI7XG4gICAgICAgICAgICAgICAgY29uZmlnID0gbmV3IEFycmF5KDIpO1xuICAgICAgICAgICAgICAgIGV4dGVuc2lvblNhbXBsaW5nSW5kZXggPSBzYW1wbGluZ0luZGV4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHVzZXJBZ2VudC5pbmRleE9mKCdhbmRyb2lkJykgIT09IC0xKSB7XG4gICAgICAgICAgICAvLyBhbmRyb2lkOiBhbHdheXMgdXNlIExDLUFBQ1xuICAgICAgICAgICAgYXVkaW9PYmplY3RUeXBlID0gMjtcbiAgICAgICAgICAgIGNvbmZpZyA9IG5ldyBBcnJheSgyKTtcbiAgICAgICAgICAgIGV4dGVuc2lvblNhbXBsaW5nSW5kZXggPSBzYW1wbGluZ0luZGV4O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gZm9yIG90aGVyIGJyb3dzZXJzLCBlLmcuIGNocm9tZS4uLlxuICAgICAgICAgICAgLy8gQWx3YXlzIHVzZSBIRS1BQUMgdG8gbWFrZSBpdCBlYXNpZXIgdG8gc3dpdGNoIGFhYyBjb2RlYyBwcm9maWxlXG4gICAgICAgICAgICBhdWRpb09iamVjdFR5cGUgPSA1O1xuICAgICAgICAgICAgZXh0ZW5zaW9uU2FtcGxpbmdJbmRleCA9IHNhbXBsaW5nSW5kZXg7XG4gICAgICAgICAgICBjb25maWcgPSBuZXcgQXJyYXkoNCk7XG5cbiAgICAgICAgICAgIGlmIChzYW1wbGluZ0luZGV4ID49IDYpIHtcbiAgICAgICAgICAgICAgICBleHRlbnNpb25TYW1wbGluZ0luZGV4ID0gc2FtcGxpbmdJbmRleCAtIDM7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5uZWxDb25maWcgPT09IDEpIHsgLy8gTW9ubyBjaGFubmVsXG4gICAgICAgICAgICAgICAgYXVkaW9PYmplY3RUeXBlID0gMjtcbiAgICAgICAgICAgICAgICBjb25maWcgPSBuZXcgQXJyYXkoMik7XG4gICAgICAgICAgICAgICAgZXh0ZW5zaW9uU2FtcGxpbmdJbmRleCA9IHNhbXBsaW5nSW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb25maWdbMF0gPSBhdWRpb09iamVjdFR5cGUgPDwgMztcbiAgICAgICAgY29uZmlnWzBdIHw9IChzYW1wbGluZ0luZGV4ICYgMHgwRikgPj4+IDE7XG4gICAgICAgIGNvbmZpZ1sxXSA9IChzYW1wbGluZ0luZGV4ICYgMHgwRikgPDwgNztcbiAgICAgICAgY29uZmlnWzFdIHw9IChjaGFubmVsQ29uZmlnICYgMHgwRikgPDwgMztcbiAgICAgICAgaWYgKGF1ZGlvT2JqZWN0VHlwZSA9PT0gNSkge1xuICAgICAgICAgICAgY29uZmlnWzFdIHw9ICgoZXh0ZW5zaW9uU2FtcGxpbmdJbmRleCAmIDB4MEYpID4+PiAxKTtcbiAgICAgICAgICAgIGNvbmZpZ1syXSA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ICAgICAgICAgIHJldHVybiB0aGlzLl92aWRlb0luaXRpYWxNZXRhZGF0YURpc3BhdGNoZWQ7XG4gICAgICAgIH1cbiAgICB9XG59XG5leHBvcnQgZGVmYXVsdCBuZXcgdGFnRGVtdXgoKTtcblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9qcy9mbHYvdGFnZGVtdXguanMiXSwic291cmNlUm9vdCI6IiJ9");
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * 代码借鉴了flv.js\n * 增加了自己的注释和写法\n */\n/* eslint-disable */\nvar MP4 = function () {\n function MP4() {\n _classCallCheck(this, MP4);\n }\n\n _createClass(MP4, null, [{\n key: 'init',\n value: function init() {\n MP4.types = {\n avc1: [],\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n mvex: [],\n mvhd: [],\n sdtp: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: [],\n smhd: []\n };\n\n for (var name in MP4.types) {\n if (MP4.types.hasOwnProperty(name)) {\n MP4.types[name] = [name.charCodeAt(0), name.charCodeAt(1), name.charCodeAt(2), name.charCodeAt(3)];\n }\n }\n\n var constants = MP4.constants = {};\n\n constants.FTYP = new Uint8Array([0x69, 0x73, 0x6F, 0x6D, // major_brand: isom\t\tisom\tMP4 Base Media v1 [IS0 14496-12:2003]\tISO\tYES\tvideo/mp4\n 0x0, 0x0, 0x0, 0x1, // minor_version: 0x01\n 0x69, 0x73, 0x6F, 0x6D, // isom\n 0x61, 0x76, 0x63, 0x31 // avc1\n ]);\n\n constants.STSD_PREFIX = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags version字段后会有一个entry count字段\n 0x00, 0x00, 0x00, 0x01 // entry_count\t根据entry的个数,每个entry会有type信息,如“vide”、“sund”等,根据type不同sample description会提供不同的信息,例如对于video track,会有“VisualSampleEntry”类型信息,对于audio track会有“AudioSampleEntry”类型信息。\n ]);\n\n constants.STTS = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags\n 0x00, 0x00, 0x00, 0x00 // entry_count 0个索引\n ]);\n\n constants.STSC = constants.STCO = constants.STTS;\n\n constants.STSZ = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n\n constants.HDLR_VIDEO = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide' 在media box中,该值为4个字符\t\t“vide”— video track\n 0x00, 0x00, 0x00, 0x00, // reserved: 3 * 4 bytes\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 保留位\n 0x56, 0x69, 0x64, 0x65, 0x6F, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x72, 0x00 // name: VideoHandler 长度不定\t\ttrack type name,以‘\\0’结尾的字符串\n ]);\n\n constants.HDLR_AUDIO = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6F, 0x75, 0x6E, // handler_type: 'soun'在media box中,该值为4个字符\t\t“soun”— audio track\n 0x00, 0x00, 0x00, 0x00, // reserved: 3 * 4 bytes\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 保留位\n 0x53, 0x6F, 0x75, 0x6E, 0x64, 0x48, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x72, 0x00 // name: SoundHandler 长度不定\t\ttrack type name,以‘\\0’结尾的字符串\n ]);\n\n constants.DREF = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags\n 0x00, 0x00, 0x00, 0x01, // entry_count 1个url\n // url\tbox开始\n 0x00, 0x00, 0x00, 0x0C, // entry_size\n 0x75, 0x72, 0x6C, 0x20, // type 'url '\n 0x00, 0x00, 0x00, 0x01 // version(0) + flags 当“url”或“urn”的box flag为1时,字符串均为空。\n ]);\n\n // Sound media header\n constants.SMHD = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags\tbox版本,0或1,一般为0。\n 0x00, 0x00, 0x00, 0x00 // balance(2) + reserved(2) 立体声平衡,[8.8] 格式值,一般为0,-1.0表示全部左声道,1.0表示全部右声道+2位保留位\n ]);\n\n // video media header\n constants.VMHD = new Uint8Array([0x00, 0x00, 0x00, 0x01, // version(0) + flags\n 0x00, 0x00, // graphicsmode: 2 bytes 视频合成模式,为0时拷贝原始图像,否则与opcolor进行合成 //理论上是4位啊 暂时保留\n 0x00, 0x00, 0x00, 0x00, // opcolor: 3 * 2 bytes {red,green,blue}\n 0x00, 0x00]);\n }\n\n /**\n * 封装box\n */\n\n }, {\n key: 'box',\n value: function box(type) {\n var size = 8;\n var result = null;\n var datas = Array.prototype.slice.call(arguments, 1);\n var arrayCount = datas.length;\n\n for (var i = 0; i < arrayCount; i++) {\n size += datas[i].byteLength;\n }\n // box头部大小\n result = new Uint8Array(size);\n result[0] = size >>> 24 & 0xFF; // size\n result[1] = size >>> 16 & 0xFF;\n result[2] = size >>> 8 & 0xFF;\n result[3] = size & 0xFF;\n // 写入box的type\n result.set(type, 4); // type\n\n var offset = 8;\n for (var _i = 0; _i < arrayCount; _i++) {\n // data body\n result.set(datas[_i], offset);\n offset += datas[_i].byteLength;\n }\n\n return result;\n }\n\n // 创建ftyp&moov\n\n }, {\n key: 'generateInitSegment',\n value: function generateInitSegment(meta) {\n if (meta.constructor != Array) {\n meta = [meta];\n }\n var ftyp = MP4.box(MP4.types.ftyp, MP4.constants.FTYP);\n var moov = MP4.moov(meta);\n\n var result = new Uint8Array(ftyp.byteLength + moov.byteLength);\n result.set(ftyp, 0);\n result.set(moov, ftyp.byteLength);\n return result;\n }\n\n // Movie metadata box\n\n }, {\n key: 'moov',\n value: function moov(meta) {\n var mvhd = MP4.mvhd(meta[0].timescale, meta[0].duration); // /moov里面的第一个box\n var vtrak = MP4.trak(meta[0]);\n var atrak = void 0;\n if (meta.length > 1) {\n atrak = MP4.trak(meta[1]);\n }\n\n var mvex = MP4.mvex(meta);\n if (meta.length > 1) {\n return MP4.box(MP4.types.moov, mvhd, vtrak, atrak, mvex);\n } else {\n return MP4.box(MP4.types.moov, mvhd, vtrak, mvex);\n }\n }\n\n // Movie header box\n\n }, {\n key: 'mvhd',\n value: function mvhd(timescale, duration) {\n return MP4.box(MP4.types.mvhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags 1位的box版本+3位flags box版本,0或1,一般为0。(以下字节数均按version=0)\n 0x00, 0x00, 0x00, 0x00, // creation_time 创建时间 (相对于UTC时间1904-01-01零点的秒数)\n 0x00, 0x00, 0x00, 0x00, // modification_time 修改时间\n timescale >>> 24 & 0xFF, // timescale: 4 bytes\t\t文件媒体在1秒时间内的刻度值,可以理解为1秒长度\n timescale >>> 16 & 0xFF, timescale >>> 8 & 0xFF, timescale & 0xFF, duration >>> 24 & 0xFF, // duration: 4 bytes\t该track的时间长度,用duration和time scale值可以计算track时长,比如audio track的time scale = 8000, duration = 560128,时长为70.016,video track的time scale = 600, duration = 42000,时长为70\n duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, 0x00, 0x01, 0x00, 0x00, // Preferred rate: 1.0 推荐播放速率,高16位和低16位分别为小数点整数部分和小数部分,即[16.16] 格式,该值为1.0(0x00010000)表示正常前向播放\n 0x01, 0x00, 0x00, 0x00, // PreferredVolume(1.0, 2bytes) + reserved(2bytes)\t与rate类似,[8.8] 格式,1.0(0x0100)表示最大音量\n 0x00, 0x00, 0x00, 0x00, // reserved: 4 + 4 bytes\t保留位\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ----begin composition matrix----\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 视频变换矩阵 线性代数\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // ----end composition matrix----\n 0x00, 0x00, 0x00, 0x00, // ----begin pre_defined 6 * 4 bytes----\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre-defined 保留位\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ----end pre_defined 6 * 4 bytes----\n 0xFF, 0xFF, 0xFF, 0xFF // next_track_ID 下一个track使用的id号\n ]));\n }\n\n // Track box\n\n }, {\n key: 'trak',\n value: function trak(meta) {\n return MP4.box(MP4.types.trak, MP4.tkhd(meta), MP4.mdia(meta));\n }\n\n // Track header box\n\n }, {\n key: 'tkhd',\n value: function tkhd(meta) {\n var trackId = meta.id,\n duration = meta.duration;\n var width = meta.presentWidth,\n height = meta.presentHeight;\n\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, 0x00, 0x00, 0x07, // version(0) + flags 1位版本 box版本,0或1,一般为0。(以下字节数均按version=0)按位或操作结果值,预定义如下:\n // 0x000001 track_enabled,否则该track不被播放;\n // 0x000002 track_in_movie,表示该track在播放中被引用;\n // 0x000004 track_in_preview,表示该track在预览时被引用。\n // 一般该值为7,1+2+4 如果一个媒体所有track均未设置track_in_movie和track_in_preview,将被理解为所有track均设置了这两项;对于hint track,该值为0\n // hint track 这个特殊的track并不包含媒体数据,而是包含了一些将其他数据track打包成流媒体的指示信息。\n 0x00, 0x00, 0x00, 0x00, // creation_time\t创建时间(相对于UTC时间1904-01-01零点的秒数)\n 0x00, 0x00, 0x00, 0x00, // modification_time\t修改时间\n trackId >>> 24 & 0xFF, // track_ID: 4 bytes\tid号,不能重复且不能为0\n trackId >>> 16 & 0xFF, trackId >>> 8 & 0xFF, trackId & 0xFF, 0x00, 0x00, 0x00, 0x00, // reserved: 4 bytes 保留位\n duration >>> 24 & 0xFF, // duration: 4 bytes \ttrack的时间长度\n duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, 0x00, 0x00, 0x00, 0x00, // reserved: 2 * 4 bytes 保留位\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // layer(2bytes) + alternate_group(2bytes) 视频层,默认为0,值小的在上层.track分组信息,默认为0表示该track未与其他track有群组关系\n 0x00, 0x00, 0x00, 0x00, // volume(2bytes) + reserved(2bytes) [8.8] 格式,如果为音频track,1.0(0x0100)表示最大音量;否则为0 +保留位\n 0x00, 0x01, 0x00, 0x00, // ----begin composition matrix----\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // 视频变换矩阵\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // ----end composition matrix----\n width >>> 8 & 0xFF, // //宽度\n width & 0xFF, 0x00, 0x00, height >>> 8 & 0xFF, // 高度\n height & 0xFF, 0x00, 0x00]));\n }\n\n /**\n * “mdia”也是个container box,其子box的结构和种类还是比较复杂的。先来看一个“mdia”的实例结构树图。\n * 总体来说,“mdia”定义了track媒体类型以及sample数据,描述sample信息。一般“mdia”包含一个“mdhd”,\n * 一个“hdlr”和一个“minf”,其中“mdhd”为media header box,“hdlr”为handler reference box,\n * “minf”为media information box。\n *\n * mdia\n * \t\tmdhd\n * \t\thdlr\n * \t\tminf\n * \t\t\tsmhd\n * \t\t\tdinf\n * \t\t\t\tdref\n * \t\t\t\t\turl\n * \t\t\tstbl\n * \t\t\t\tstsd\n * \t\t\t\t\tmp4a\n * \t\t\t\t\t\tesds\n * \t\t\t\tstts\n * \t\t\t\tstsc\n * \t\t\t\tstsz\n * \t\t\t\tstco\n */\n\n }, {\n key: 'mdia',\n value: function mdia(meta) {\n return MP4.box(MP4.types.mdia, MP4.mdhd(meta), MP4.hdlr(meta), MP4.minf(meta));\n }\n\n // Media header box\n\n }, {\n key: 'mdhd',\n value: function mdhd(meta) {\n var timescale = meta.timescale;\n var duration = meta.duration;\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags // version(0) + flags\t\tbox版本,0或1,一般为0。\n 0x00, 0x00, 0x00, 0x00, // creation_time 创建时间\n 0x00, 0x00, 0x00, 0x00, // modification_time修改时间\n timescale >>> 24 & 0xFF, // timescale: 4 bytes 文件媒体在1秒时间内的刻度值,可以理解为1秒长度\n timescale >>> 16 & 0xFF, timescale >>> 8 & 0xFF, timescale & 0xFF, duration >>> 24 & 0xFF, // duration: 4 bytes track的时间长度\n duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, 0x55, 0xC4, // language: und (undetermined) 媒体语言码。最高位为0,后面15位为3个字符(见ISO 639-2/T标准中定义)\n 0x00, 0x00 // pre_defined = 0\n ]));\n }\n\n // Media handler reference box\n\n }, {\n key: 'hdlr',\n value: function hdlr(meta) {\n var data = null;\n if (meta.type === 'audio') {\n data = MP4.constants.HDLR_AUDIO;\n } else {\n data = MP4.constants.HDLR_VIDEO;\n }\n return MP4.box(MP4.types.hdlr, data);\n }\n\n /**\n * “minf”存储了解释track媒体数据的handler-specific信息,media handler用这些信息将媒体时间映射到媒体数据并进行处理。“minf”中的信息格式和内容与媒体类型以及解释媒体数据的media handler密切相关,其他media handler不知道如何解释这些信息。“minf”是一个container box,其实际内容由子box说明。\n 一般情况下,“minf”包含一个header box,一个“dinf”和一个“stbl”,其中,header box根据track type(即media handler type)分为“vmhd”、“smhd”、“hmhd”和“nmhd”,“dinf”为data information box,“stbl”为sample table box。下面分别介绍。\n *\n */\n // Media infomation box\n\n }, {\n key: 'minf',\n value: function minf(meta) {\n // header box根据track type(即media handler type)分为“vmhd”、“smhd”、“hmhd”和“nmhd”\n var xmhd = null;\n if (meta.type === 'audio') {\n xmhd = MP4.box(MP4.types.smhd, MP4.constants.SMHD);\n } else {\n xmhd = MP4.box(MP4.types.vmhd, MP4.constants.VMHD);\n }\n return MP4.box(MP4.types.minf, xmhd, MP4.dinf(), MP4.stbl(meta));\n }\n\n /**\n * Data Information Box\n * “dinf”解释如何定位媒体信息,是一个container box。“dinf”一般包含一个“dref”,即data reference box;\n * “dref”下会包含若干个“url”或“urn”,这些box组成一个表,用来定位track数据。\n * 简单的说,track可以被分成若干段,每一段都可以根据“url”或“urn”指向的地址来获取数据,\n * sample描述中会用这些片段的序号将这些片段组成一个完整的track。\n * 一般情况下,当数据被完全包含在文件中时,“url”或“urn”中的定位字符串是空的。\n */\n\n }, {\n key: 'dinf',\n value: function dinf() {\n var result = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, MP4.constants.DREF));\n return result;\n }\n\n /**\n * Sample Table Box(stbl)\n \t*\t“stbl”几乎是普通的MP4文件中最复杂的一个box了,首先需要回忆一下sample的概念。\n * \tsample是媒体数据存储的单位,存储在media的chunk中,chunk和sample的长度均可互不相同,如下图所示。\n “stbl”是一个container box,其子box包括:sample description box(stsd)、\n * time to sample box(stts)、sample size box(stsz或stz2)、\n * sample to chunk box(stsc)、chunk offset box(stco或co64)、\n * composition time to sample box(ctts)、sync sample box(stss)\n * stsd”必不可少,且至少包含一个条目,该box包含了data reference box进行sample数据检索的信息。\n * 没有“stsd”就无法计算media sample的存储位置。“stsd”包含了编码的信息,其存储的信息随媒体类型不同而不同。\n * \t\t\tstbl\n * \t\t\t\tstsd\n * \t\t\t\t\tavc1\n * \t\t\t\t\t\tavcC\n * \t\t\t\tstts\n * \t\t\t\tstsc\n * \t\t\t\tstsz\n * \t\t\t\tstco\n */\n\n }, {\n key: 'stbl',\n value: function stbl(meta) {\n var result = MP4.box(MP4.types.stbl, // type: stbl\n MP4.stsd(meta), // Sample Description Table\n MP4.box(MP4.types.stts, MP4.constants.STTS), // Time-To-Sample 因为stts的entry count 为0\n // 所以没有关键帧index 的stss\n // 也没有CTTS box CTTS是记录偏移量\n MP4.box(MP4.types.stsc, MP4.constants.STSC), // Sample-To-Chunk\n MP4.box(MP4.types.stsz, MP4.constants.STSZ), // Sample size\n MP4.box(MP4.types.stco, MP4.constants.STCO) // Chunk offset\n );\n return result;\n }\n\n /**\n * Sample Description Box(stsd)\n \t\tbox header和version字段后会有一个entry count字段,\n * \t\t\t根据entry的个数,每个entry会有type信息,如“vide”、“sund”等,\n * \t\t根据type不同sample description会提供不同的信息,例如对于video track,\n * 会有“VisualSampleEntry”类型信息,对于audio track会有“AudioSampleEntry”类型信息。\n * * \t\t\t\tstsd\n * \t\t\t\t\tmp4a\n * \t\t\t\t\t\tesds\n *\n *\n *\n *\n * \t\t 4 bytes - length in total\n \t 4 bytes - 4 char code of sample description table (stsd)\n \t 4 bytes - version & flags\n \t 4 bytes - number of sample entries (num_sample_entries)\n \t\t [\n \t\t 4 bytes - length of sample entry (len_sample_entry)\n \t\t 4 bytes - 4 char code of sample entry\n \t\t ('len_sample_entry' - 8) bytes of data\n \t\t ] (repeated 'num_sample_entries' times)\n \t(4 bytes - optional 0x00000000 as end of box marker )\n */\n\n }, {\n key: 'stsd',\n value: function stsd(meta) {\n if (meta.type === 'audio') {\n return MP4.box(MP4.types.stsd, MP4.constants.STSD_PREFIX, MP4.mp4a(meta));\n } else {\n return MP4.box(MP4.types.stsd, MP4.constants.STSD_PREFIX, MP4.avc1(meta));\n }\n }\n }, {\n key: 'mp4a',\n value: function mp4a(meta) {\n var channelCount = meta.channelCount;\n var sampleRate = meta.audioSampleRate;\n\n var data = new Uint8Array([0x00, 0x00, 0x00, 0x00, // reserved(4) 6个字节,设置为0;\n 0x00, 0x00, 0x00, 0x01, // reserved(2) + data_reference_index(2)\n 0x00, 0x00, 0x00, 0x00, // reserved: 2 * 4 bytes 保留位\n 0x00, 0x00, 0x00, 0x00, 0x00, channelCount, // channelCount(2) 单声道还是双声道\n 0x00, 0x10, // sampleSize(2)\n 0x00, 0x00, 0x00, 0x00, // reserved(4) 4字节保留位\n sampleRate >>> 8 & 0xFF, // Audio sample rate 显然要右移16位才有意义\ttemplate unsigned int(32) samplerate = {timescale of media}<<16;\n sampleRate & 0xFF, 0x00, 0x00]);\n\n return MP4.box(MP4.types.mp4a, data, MP4.esds(meta));\n }\n }, {\n key: 'esds',\n value: function esds(meta) {\n var config = meta.config;\n var configSize = config.length;\n var data = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version 0 + flags\n\n 0x03, // descriptor_type MP4ESDescrTag\n 0x17 + configSize, // length3\n 0x00, 0x01, // es_id\n 0x00, // stream_priority\n\n 0x04, // descriptor_type MP4DecConfigDescrTag\n 0x0F + configSize, // length\n 0x40, // codec: mpeg4_audio\n /**\n *当objectTypeIndication为0x40时,为MPEG-4 Audio(MPEG-4 Audio generally is thought of as AAC\n * but there is a whole framework of audio codecs that can Go in MPEG-4 Audio including AAC, BSAC, ALS, CELP,\n * and something called MP3On4),如果想更细分format为aac还是mp3,\n * 可以读取MP4DecSpecificDescr层data[0]的前五位\n */\n 0x15, // stream_type: Audio\n 0x00, 0x00, 0x00, // buffer_size\n 0x00, 0x00, 0x00, 0x00, // maxBitrate\n 0x00, 0x00, 0x00, 0x00, // avgBitrate\n\n 0x05 // descriptor_type MP4DecSpecificDescrTag\n ].concat([configSize]).concat(config).concat([0x06, 0x01, 0x02 // GASpecificConfig\n ]));\n return MP4.box(MP4.types.esds, data);\n }\n\n /**\n * 改版\n *stsd下的avc1视频解析\n */\n\n }, {\n key: 'avc1',\n value: function avc1(meta) {\n var avcc = meta.avcc;\n var width = meta.codecWidth,\n height = meta.codecHeight;\n\n var data = new Uint8Array([0x00, 0x00, 0x00, 0x00, // // reserved(4) 6个 保留位\tReserved:6个字节,设置为0;\n 0x00, 0x00, 0x00, 0x01, // reserved(2) + {{{{data_reference_index(2) 数据引用索引}}}}\n 0x00, 0x00, 0x00, 0x00, // pre_defined(2) + reserved(2)\n 0x00, 0x00, 0x00, 0x00, // pre_defined: 3 * 4 bytes 3*4个字节的保留位\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, width >>> 8 & 0xFF, // width: 2 bytes\n width & 0xFF, height >>> 8 & 0xFF, // height: 2 bytes\n height & 0xFF, 0x00, 0x48, 0x00, 0x00, // horizresolution: 4 bytes 常数\n 0x00, 0x48, 0x00, 0x00, // vertresolution: 4 bytes 常数\n 0x00, 0x00, 0x00, 0x00, // reserved: 4 bytes 保留位\n 0x00, 0x01, // frame_count\n // frame_count表明多少帧压缩视频存储在每个样本。默认是1,每样一帧;它可能超过1每个样本的多个帧数\n 0x04, //\tstrlen compressorname: 32 bytes\t\t\tString[32]\n // 32个8 bit 第一个8bit表示长度,剩下31个8bit表示内容\n 0x67, 0x31, 0x31, 0x31, // compressorname: 32 bytes 翻译过来是g111\n 0x00, 0x00, 0x00, 0x00, //\n 0x00, 0x00, 0x00, 0x00, //\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, // depth 颜色深度\n 0xFF, 0xFF // pre_defined = -1\n ]);\n return MP4.box(MP4.types.avc1, data, MP4.box(MP4.types.avcC, avcc));\n }\n\n // Movie Extends box\n\n }, {\n key: 'mvex',\n value: function mvex(meta) {\n if (meta.length > 1) {\n return MP4.box(MP4.types.mvex, MP4.trex(meta[0]), MP4.trex(meta[1]));\n } else {\n return MP4.box(MP4.types.mvex, MP4.trex(meta[0]));\n }\n }\n\n // Track Extends box\n\n }, {\n key: 'trex',\n value: function trex(meta) {\n var trackId = meta.id;\n var data = new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) + flags\n trackId >>> 24 & 0xFF, // track_ID\n trackId >>> 16 & 0xFF, trackId >>> 8 & 0xFF, trackId & 0xFF, 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]);\n // if (meta.type !== 'video') {\n // data[data.length - 1] = 0x00;\n // }\n return MP4.box(MP4.types.trex, data);\n }\n\n // Movie fragment box\n\n }, {\n key: 'moof',\n value: function moof(track, baseMediaDecodeTime) {\n return MP4.box(MP4.types.moof, MP4.mfhd(track.sequenceNumber), MP4.traf(track, baseMediaDecodeTime));\n }\n }, {\n key: 'mfhd',\n value: function mfhd(sequenceNumber) {\n var data = new Uint8Array([0x00, 0x00, 0x00, 0x00, sequenceNumber >>> 24 & 0xFF, // sequence_number: int32\n sequenceNumber >>> 16 & 0xFF, sequenceNumber >>> 8 & 0xFF, sequenceNumber & 0xFF]);\n return MP4.box(MP4.types.mfhd, data);\n }\n\n // Track fragment box\n\n }, {\n key: 'traf',\n value: function traf(track, baseMediaDecodeTime) {\n var trackId = track.id;\n\n // Track fragment header box\n var tfhd = MP4.box(MP4.types.tfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) & flags\n trackId >>> 24 & 0xFF, // track_ID\n trackId >>> 16 & 0xFF, trackId >>> 8 & 0xFF, trackId & 0xFF]));\n // Track Fragment Decode Time\n var tfdt = MP4.box(MP4.types.tfdt, new Uint8Array([0x00, 0x00, 0x00, 0x00, // version(0) & flags\n baseMediaDecodeTime >>> 24 & 0xFF, // baseMediaDecodeTime: int32\n baseMediaDecodeTime >>> 16 & 0xFF, baseMediaDecodeTime >>> 8 & 0xFF, baseMediaDecodeTime & 0xFF]));\n var sdtp = MP4.sdtp(track);\n var trun = MP4.trun(track, sdtp.byteLength + 16 + 16 + 8 + 16 + 8 + 8);\n\n return MP4.box(MP4.types.traf, tfhd, tfdt, trun, sdtp);\n }\n\n // Sample Dependency Type box\n\n }, {\n key: 'sdtp',\n value: function sdtp(track) {\n var samples = track.samples || [];\n var sampleCount = samples.length;\n var data = new Uint8Array(4 + sampleCount);\n // 0~4 bytes: version(0) & flags\n for (var i = 0; i < sampleCount; i++) {\n var flags = samples[i].flags;\n data[i + 4] = flags.isLeading << 6 | // is_leading: 2 (bit)\n flags.dependsOn << 4 // sample_depends_on\n | flags.isDependedOn << 2 // sample_is_depended_on\n | flags.hasRedundancy; // sample_has_redundancy\n }\n return MP4.box(MP4.types.sdtp, data);\n }\n\n // Track fragment run box\n\n }, {\n key: 'trun',\n value: function trun(track, offset) {\n var samples = track.samples || [];\n var sampleCount = samples.length;\n var dataSize = 12 + 16 * sampleCount;\n var data = new Uint8Array(dataSize);\n offset += 8 + dataSize;\n\n data.set([0x00, 0x00, 0x0F, 0x01, // version(0) & flags\n sampleCount >>> 24 & 0xFF, // sample_count\n sampleCount >>> 16 & 0xFF, sampleCount >>> 8 & 0xFF, sampleCount & 0xFF, offset >>> 24 & 0xFF, // data_offset\n offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF], 0);\n\n for (var i = 0; i < sampleCount; i++) {\n\n var duration = samples[i].duration;\n\n var size = samples[i].size;\n var flags = samples[i].flags;\n var cts = samples[i].cts;\n data.set([duration >>> 24 & 0xFF, // sample_duration\n duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, size >>> 24 & 0xFF, // sample_size\n size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, flags.isLeading << 2 | flags.dependsOn, // sample_flags\n flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.isNonSync, 0x00, 0x00, // sample_degradation_priority\n cts >>> 24 & 0xFF, // sample_composition_time_offset\n cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF], 12 + 16 * i);\n }\n return MP4.box(MP4.types.trun, data);\n }\n }, {\n key: 'mdat',\n value: function mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n }]);\n\n return MP4;\n}();\n\nMP4.init();\n\nexports.default = MP4;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9tcDQvbXA0cmVtdXguanM/OWY1YSJdLCJuYW1lcyI6WyJNUDQiLCJ0eXBlcyIsImF2YzEiLCJhdmNDIiwiYnRydCIsImRpbmYiLCJkcmVmIiwiZXNkcyIsImZ0eXAiLCJoZGxyIiwibWRhdCIsIm1kaGQiLCJtZGlhIiwibWZoZCIsIm1pbmYiLCJtb29mIiwibW9vdiIsIm1wNGEiLCJtdmV4IiwibXZoZCIsInNkdHAiLCJzdGJsIiwic3RjbyIsInN0c2MiLCJzdHNkIiwic3RzeiIsInN0dHMiLCJ0ZmR0IiwidGZoZCIsInRyYWYiLCJ0cmFrIiwidHJ1biIsInRyZXgiLCJ0a2hkIiwidm1oZCIsInNtaGQiLCJuYW1lIiwiaGFzT3duUHJvcGVydHkiLCJjaGFyQ29kZUF0IiwiY29uc3RhbnRzIiwiRlRZUCIsIlVpbnQ4QXJyYXkiLCJTVFNEX1BSRUZJWCIsIlNUVFMiLCJTVFNDIiwiU1RDTyIsIlNUU1oiLCJIRExSX1ZJREVPIiwiSERMUl9BVURJTyIsIkRSRUYiLCJTTUhE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XZjQzogW10sXG4gICAgICAgICAgICBidHJ0OiBbXSxcbiAgICAgICAgICAgIGRpbmY6IFtdLFxuICAgICAgICAgICAgZHJlZjogW10sXG4gICAgICAgICAgICBlc2RzOiBbXSxcbiAgICAgICAgICAgIGZ0eXA6IFtdLFxuICAgICAgICAgICAgaGRscjogW10sXG4gICAgICAgICAgICBtZGF0OiBbXSxcbiAgICAgICAgICAgIG1kaGQ6IFtdLFxuICAgICAgICAgICAgbWRpYTogW10sXG4gICAgICAgICAgICBtZmhkOiBbXSxcbiAgICAgICAgICAgIG1pbmY6IFtdLFxuICAgICAgICAgICAgbW9vZjogW10sXG4gICAgICAgICAgICBtb292OiBbXSxcbiAgICAgICAgICAgIG1wNGE6IFtdLFxuICAgICAgICAgICAgbXZleDogW10sXG4gICAgICAgICAgICBtdmhkOiBbXSxcbiAgICAgICAgICAgIHNkdHA6IFtdLFxuICAgICAgICAgICAgc3RibDogW10sXG4gICAgICAgICAgICBzdGNvOiBbXSxcbiAgICAgICAgICAgIHN0c2M6IFtdLFxuICAgICAgICAgICAgc3RzZDogW10sXG4gICAgICAgICAgICBzdHN6OiBbXSxcbiAgICAgICAgICAgIHN0dHM6IFtdLFxuICAgICAgICAgICAgdGZkdDogW10sXG4gICAgICAgICAgICB0ZmhkOiBbXSxcbiAgICAgICAgICAgIHRyYWY6IFtdLFxuICAgICAgICAgICAgdHJhazogW10sXG4gICAgICAgICAgICB0cnVuOiBbXSxcbiAgICAgICAgICAgIHRyZXg6IFtdLFxuICAgICAgICAgICAgdGtoZDogW10sXG4gICAgICAgICAgICB2bWhkOiBbXSxcbiAgICAgICAgICAgIHNtaGQ6IFtdXG4gICAgICAgIH07XG5cbiAgICAgICAgZm9yIChjb25zdCBuYW1lIGluIE1QNC50eXBlcykge1xuICAgICAgICAgICAgaWYgKE1QNC50eXBlcy5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xuICAgICAgICAgICAgICAgIE1QNC50eXBlc1tuYW1lXSA9IFtcbiAgICAgICAgICAgICAgICAgICAgbmFtZS5jaGFyQ29kZUF0KDApLFxuICAgICAgICAgICAgICAgICAgICBuYW1lLmNoYXJDb2RlQXQoMSksXG4gICAgICAgICAgICAgICAgICAgIG5hbWUuY2hhckNvZGVBdCgyKSxcbiAgICAgICAgICAgICAgICAgICAgbmFtZS5jaGFyQ29kZUF0KDMpXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGNvbnN0YW50cyA9IE1QNC5jb25zdGFudHMgPSB7fTtcblxuICAgICAgICBjb25zdGFudHMuRlRZUCA9IG5ldyBVaW50OEFycmF5KFtcbiAgICAgICAgICAgIDB4NjksIDB4NzMsIDB4NkYsIDB4NkQsIC8vIG1ham9yX2JyYW5kOiBpc29tXHRcdGlzb21cdE1QNCAgQmFzZSBNZWRpYSB2MSBbSVMwIDE0NDk2LTEyOjIwMDNdXHRJU09cdFlFU1x0dmlkZW8vbXA0XG4gICAgICAgICAgICAweDAsIDB4MCwgMHgwLCAweDEsIC8vIG1pbm9yX3ZlcnNpb246IDB4MDFcbiAgICAgICAgICAgIDB4NjksIDB4NzMsIDB4NkYsIDB4NkQsIC8vIGlzb21cbiAgICAgICAgICAgIDB4NjEsIDB4NzYsIDB4NjMsIDB4MzEgLy8gYXZjMVxuICAgICAgICBdKTtcblxuICAgICAgICBjb25zdGFudHMuU1RTRF9QUkVGSVggPSBuZXcgVWludDhBcnJheShbXG4gICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAvLyB2ZXJzaW9uKDApICsgZmxhZ3MgIHZlcnNpb27lrZfmrrXlkI7kvJrmnInkuIDkuKplbnRyeSBjb3VudOWtl+autVxuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMSAvLyBlbnRyeV9jb3VudFx05qC55o2uZW50cnnnmoTkuKrmlbDvvIzmr4/kuKplbnRyeeS8muaciXR5cGXkv6Hmga/vvIzlpoLigJx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9rnRyYWNrX2luX21vdmll5ZKMdHJhY2tfaW5fcHJldmlld++8jOWwhuiiq+eQhuino+S4uuaJgOaciXRyYWNr5Z2H6K6+572u5LqG6L+Z5Lik6aG577yb5a+55LqOaGludCB0cmFja++8jOivpeWAvOS4ujBcbiAgICAgICAgICAgIC8vIGhpbnQgdHJhY2vCoCDov5nkuKrnibnmrornmoR0cmFja+W5tuS4jeWMheWQq+WqkuS9k+aVsOaNru+8jOiAjOaYr+WMheWQq+S6huS4gOS6m+WwhuWFtuS7luaVsOaNrnRyYWNr5omT5YyF5oiQ5rWB5aqS5L2T55qE5oyH56S65L+h5oGv44CCXG4gICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAvLyBjcmVhdGlvbl90aW1lXHTliJvlu7rml7bpl7TvvIjnm7jlr7nkuo5VVEPml7bpl7QxOTA0LTAxLTAx6Zu254K555qE56eS5pWw77yJXG4gICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAvLyBtb2RpZmljYXRpb25fdGltZVx05L+u5pS55pe26Ze0XG4gICAgICAgICAgICAodHJhY2tJZCA+Pj4gMjQpICYgMHhGRiwgLy8gdHJhY2tfSUQ6IDQgYnl0ZXNcdGlk5Y+377yM5LiN6IO96YeN5aSN5LiU5LiN6IO95Li6MFxuICAgICAgICAgICAgKHRyYWNrSWQgPj4+IDE2KSAmIDB4RkYsXG4gICAgICAgICAgICAodHJhY2tJZCA+Pj4gOCkgJiAweEZGLFxuICAgICAgICAgICAgKHRyYWNrSWQpICYgMHhGRixcbiAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIC8vIHJlc2VydmVkOiA0IGJ5dGVzICAgIOS/neeVmeS9jVxuICAgICAgICAgICAgKGR1cmF0aW9uID4+PiAyNCkgJiAweEZGLCAvLyBkdXJhdGlvbjogNCBieXRlcyAgXHR0cmFja+eahOaXtumXtOmVv+W6plxuICAgICAgICAgICAgKGR1cmF0aW9uID4+PiAxNikgJi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EZXNjclRhZ1xuICAgICAgICBdLmNvbmNhdChbXG4gICAgICAgICAgICBjb25maWdTaXplXG4gICAgICAgIF0pLmNvbmNhdChcbiAgICAgICAgICAgIGNvbmZpZ1xuICAgICAgICApLmNvbmNhdChbXG4gICAgICAgICAgICAweDA2LCAweDAxLCAweDAyIC8vIEdBU3BlY2lmaWNDb25maWdcbiAgICAgICAgXSkpO1xuICAgICAgICByZXR1cm4gTVA0LmJveChNUDQudHlwZXMuZXNkcywgZGF0YSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICog5pS554mIXG4gICAgICpzdHNk5LiL55qEYXZjMeinhumikeino+aekFxuICAgICAqL1xuICAgIHN0YXRpYyBhdmMxKG1ldGEpIHtcbiAgICAgICAgY29uc3QgYXZjYyA9IG1ldGEuYXZjYztcbiAgICAgICAgbGV0IHdpZHRoID0gbWV0YS5jb2RlY1dpZHRoLFxuICAgICAgICAgICAgaGVpZ2h0ID0gbWV0YS5jb2RlY0hlaWdodDtcblxuICAgICAgICBjb25zdCBkYXRhID0gbmV3IFVpbnQ4QXJyYXkoW1xuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgLy8gLy8gcmVzZXJ2ZWQoNCkgICAgNuS4qsKg5L+d55WZ5L2NXHRSZXNlcnZlZO+8mjbkuKrlrZfoioLvvIzorr7nva7kuLow77ybXG4gICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAvLyByZXNlcnZlZCgyKSArIHt7e3tkYXRhX3JlZmVyZW5jZV9pbmRleCgyKSAg5pWw5o2u5byV55So57Si5byVfX19fVxuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgLy8gcHJlX2RlZmluZWQoMikgKyByZXNlcnZlZCgyKVxuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgLy8gcHJlX2RlZmluZWQ6IDMgKiA0IGJ5dGVzICAzKjTkuKrlrZfoioLnmoTkv53nlZnkvY1cbiAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsXG4gICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLFxuICAgICAgICAgICAgKHdpZHRoID4+PiA4KSAmIDB4RkYsIC8vIHdpZHRoOiAyIGJ5dGVzXG4gICAgICAgICAgICAod2lkdGgpICYgMHhGRixcbiAgICAgICAgICAgIChoZWlnaHQgPj4+IDgpICYgMHhGRiwgLy8gaGVpZ2h0OiAyIGJ5dGVzXG4gICAgICAgICAgICAoaGVpZ2h0KSAmIDB4RkYsXG4gICAgICAgICAgICAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAvLyBob3JpenJlc29sdXRpb246IDQgYnl0ZXMg5bi45pWwXG4gICAgICAgICAgICAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAvLyB2ZXJ0cmVzb2x1dGlvbjogNCBieXRlcyDluLjmlbBcbiAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIC8vIHJlc2VydmVkOiA0IGJ5dGVzIOS/neeVmeS9jVxuICAgICAgICAgICAgMHgwMCwgMHgwMSwgLy8gZnJhbWVfY291bnRcbiAgICAgICAgICAgIC8vIGZyYW1lX2NvdW506KGo5piO5aSa5bCR5bin5Y6L57yp6KeG6aKR5a2Y5YKo5Zyo5q+P5Liq5qC35pys44CC6buY6K6k5pivMSzmr4/moLfkuIDluKc75a6D5Y+v6IO96LaF6L+HMeavj+S4quagt+acrOeahOWkmuS4quW4p+aVsFxuICAgICAgICAgICAgMHgwNCwgLy9cdHN0cmxlbiBjb21wcmVzc29ybmFtZTogMzIgYnl0ZXNcdFx0XHRTdHJpbmdbMzJdXG4gICAgICAgICAgICAvLyAzMuS4qjggYml0ICAgIOesrOS4gOS4qjhiaXTooajnpLrplb/luqYs5Ymp5LiLMzHkuKo4Yml06KGo56S65YaF5a65XG4gICAgICAgICAgICAweDY3LCAweDMxLCAweDMxLCAweDMxLCAvLyBjb21wcmVzc29ybmFtZTogMzIgYnl0ZXMgICAg57+76K+R6L+H5p2l5pivZzExMVxuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgLy9cbiAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIC8vXG4gICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLFxuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCxcbiAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsXG4gICAgICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLFxuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCxcbiAgICAgICAgICAgIDB4MDAsIDB4MTgsIC8vIGRlcHRoIOminOiJsua3seW6plxuICAgICAgICAgICAgMHhGRiwgMHhGRiAvLyBwcmVfZGVmaW5lZCA9IC0xXG4gICAgICAgIF0pO1xuICAgICAgICByZXR1cm4gTVA0LmJveChNUDQudHlwZXMuYXZjMSwgZGF0YSwgTVA0LmJveChNUDQudHlwZXMuYXZjQywgYXZjYykpO1xuICAgIH1cblxuICAgIC8vIE1vdmllIEV4dGVuZHMgYm94XG4gICAgc3RhdGljIG12ZXgobWV0YSkge1xuICAgICAgICBpZiAobWV0YS5sZW5ndGggPiAxKSB7IHJldHVybiBNUDQuYm94KE1QNC50eXBlcy5tdmV4LCBNUDQudHJleChtZXRhWzBdKSwgTVA0LnRyZXgobWV0YVsxXSkpOyB9IGVsc2UgeyByZXR1cm4gTVA0LmJveChNUDQudHlwZXMubXZleCwgTVA0LnRyZXgobWV0YVswXSkpOyB9XG4gICAgfVxuXG4gICAgLy8gVHJhY2sgRXh0ZW5kcyBib3hcbiAgICBzdGF0aWMgdHJleChtZXRhKSB7XG4gICAgICAgIGNvbnN0IHRyYWNrSWQgPSBtZXRhLmlkO1xuICAgICAgICBjb25zdCBkYXRhID0gbmV3IFVpbnQ4QXJyYXkoW1xuICAgICAgICAgICAgMHgwM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maGQoc2VxdWVuY2VOdW1iZXIpIHtcbiAgICAgICAgY29uc3QgZGF0YSA9IG5ldyBVaW50OEFycmF5KFtcbiAgICAgICAgICAgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsXG4gICAgICAgICAgICAoc2VxdWVuY2VOdW1iZXIgPj4+IDI0KSAmIDB4RkYsIC8vIHNlcXVlbmNlX251bWJlcjogaW50MzJcbiAgICAgICAgICAgIChzZXF1ZW5jZU51bWJlciA+Pj4gMTYpICYgMHhGRixcbiAgICAgICAgICAgIChzZXF1ZW5jZU51bWJlciA+Pj4gOCkgJiAweEZGLFxuICAgICAgICAgICAgKHNlcXVlbmNlTnVtYmVyKSAmIDB4RkZcbiAgICAgICAgXSk7XG4gICAgICAgIHJldHVybiBNUDQuYm94KE1QNC50eXBlcy5tZmhkLCBkYXRhKTtcbiAgICB9XG5cbiAgICAvLyBUcmFjayBmcmFnbWVudCBib3hcbiAgICBzdGF0aWMgdHJhZih0cmFjaywgYmFzZU1lZGlhRGVjb2RlVGltZSkge1xuICAgICAgICBjb25zdCB0cmFja0lkID0gdHJhY2suaWQ7XG5cbiAgICAgICAgLy8gVHJhY2sgZnJhZ21lbnQgaGVhZGVyIGJveFxuICAgICAgICBjb25zdCB0ZmhkID0gTVA0LmJveChNUDQudHlwZXMudGZoZCwgbmV3IFVpbnQ4QXJyYXkoW1xuICAgICAgICAgICAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgLy8gdmVyc2lvbigwKSAmIGZsYWdzXG4gICAgICAgICAgICAodHJhY2tJZCA+Pj4gMjQpICYgMHhGRiwgLy8gdHJhY2tfSURcbiAgICAgICAgICAgICh0cmFja0lkID4+PiAxNikgJiAweEZGLFxuICAgICAgICAgICAgKHRyYWNrSWQgPj4+IDgpICYgMHhGRixcbiAgICAgICAgICAgICh0cmFja0lkKSAmIDB4RkZcbiAgICAgICAgXSkpO1xuICAgICAgICAvLyBUcmFjayBGcmFnbWVudCBEZWNvZGUgVGltZVxuICAg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vdW50ID4+PiAyNCkgJiAweEZGLCAvLyBzYW1wbGVfY291bnRcbiAgICAgICAgICAgIChzYW1wbGVDb3VudCA+Pj4gMTYpICYgMHhGRixcbiAgICAgICAgICAgIChzYW1wbGVDb3VudCA+Pj4gOCkgJiAweEZGLFxuICAgICAgICAgICAgKHNhbXBsZUNvdW50KSAmIDB4RkYsXG4gICAgICAgICAgICAob2Zmc2V0ID4+PiAyNCkgJiAweEZGLCAvLyBkYXRhX29mZnNldFxuICAgICAgICAgICAgKG9mZnNldCA+Pj4gMTYpICYgMHhGRixcbiAgICAgICAgICAgIChvZmZzZXQgPj4+IDgpICYgMHhGRixcbiAgICAgICAgICAgIChvZmZzZXQpICYgMHhGRlxuICAgICAgICBdLCAwKTtcblxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHNhbXBsZUNvdW50OyBpKyspIHtcblxuICAgICAgICAgICAgY29uc3QgZHVyYXRpb24gPSBzYW1wbGVzW2ldLmR1cmF0aW9uO1xuXG4gICAgICAgICAgICBjb25zdCBzaXplID0gc2FtcGxlc1tpXS5zaXplO1xuICAgICAgICAgICAgY29uc3QgZmxhZ3MgPSBzYW1wbGVzW2ldLmZsYWdzO1xuICAgICAgICAgICAgY29uc3QgY3RzID0gc2FtcGxlc1tpXS5jdHM7XG4gICAgICAgICAgICBkYXRhLnNldChbXG4gICAgICAgICAgICAgICAgKGR1cmF0aW9uID4+PiAyNCkgJiAweEZGLCAvLyBzYW1wbGVfZHVyYXRpb25cbiAgICAgICAgICAgICAgICAoZHVyYXRpb24gPj4+IDE2KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgKGR1cmF0aW9uID4+PiA4KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgKGR1cmF0aW9uKSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgKHNpemUgPj4+IDI0KSAmIDB4RkYsIC8vIHNhbXBsZV9zaXplXG4gICAgICAgICAgICAgICAgKHNpemUgPj4+IDE2KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgKHNpemUgPj4+IDgpICYgMHhGRixcbiAgICAgICAgICAgICAgICAoc2l6ZSkgJiAweEZGLFxuICAgICAgICAgICAgICAgIChmbGFncy5pc0xlYWRpbmcgPDwgMikgfCBmbGFncy5kZXBlbmRzT24sIC8vIHNhbXBsZV9mbGFnc1xuICAgICAgICAgICAgICAgIChmbGFncy5pc0RlcGVuZGVkT24gPDwgNikgfCAoZmxhZ3MuaGFzUmVkdW5kYW5jeSA8PCA0KSB8IGZsYWdzLmlzTm9uU3luYyxcbiAgICAgICAgICAgICAgICAweDAwLCAweDAwLCAvLyBzYW1wbGVfZGVncmFkYXRpb25fcHJpb3JpdHlcbiAgICAgICAgICAgICAgICAoY3RzID4+PiAyNCkgJiAweEZGLCAvLyBzYW1wbGVfY29tcG9zaXRpb25fdGltZV9vZmZzZXRcbiAgICAgICAgICAgICAgICAoY3RzID4+PiAxNikgJiAweEZGLFxuICAgICAgICAgICAgICAgIChjdHMgPj4+IDgpICYgMHhGRixcbiAgICAgICAgICAgICAgICAoY3RzKSAmIDB4RkZcbiAgICAgICAgICAgIF0sIDEyICsgMTYgKiBpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gTVA0LmJveChNUDQudHlwZXMudHJ1biwgZGF0YSk7XG4gICAgfVxuXG4gICAgc3RhdGljIG1kYXQoZGF0YSkge1xuICAgICAgICByZXR1cm4gTVA0LmJveChNUDQudHlwZXMubWRhdCwgZGF0YSk7XG4gICAgfVxuXG59XG5cbk1QNC5pbml0KCk7XG5cbmV4cG9ydCBkZWZhdWx0IE1QNDtcblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9qcy9tcDQvbXA0cmVtdXguanMiXSwic291cmNlUm9vdCI6IiJ9");
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nvar _flv2fmp = __webpack_require__(10);\n\nvar _flv2fmp2 = _interopRequireDefault(_flv2fmp);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// var cpu=require('chimee-flv2fmp4')\n\nvar temp = new _flv2fmp2.default(); /* eslint-disable */\n\nconsole.log(temp);\nwindow.flvParse = {\n mp4File: null,\n succ: null,\n // ftyp_moov:null,\n tracks: [],\n baseTime: 0,\n setFlv: function setFlv(uint8, baseTime) {\n if (flvParse.baseTime != baseTime) {\n flvParse.baseTime = baseTime;\n temp.seek(baseTime);\n }\n if (window.mp4Init) {\n temp.onInitSegment = window.mp4Init;\n }\n if (window.onMediaSegment) {\n temp.onMediaSegment = window.onMediaSegment;\n }\n if (window.seekCallBack) {\n // temp.seekCallBack = window.se\n temp.seekCallBack = window.seekCallBack;\n }\n if (window.onMediaInfo) {\n temp.onMediaInfo = window.onMediaInfo;\n }\n return temp.setflv(uint8.buffer, baseTime);\n\n // 用来获取moov\n },\n setLocFlv: function setLocFlv(uin8) {\n return temp.setflvloc(uin8);\n }\n};//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9mbHZFbnRlci5qcz9iZGJiIl0sIm5hbWVzIjpbInRlbXAiLCJjb25zb2xlIiwibG9nIiwid2luZG93IiwiZmx2UGFyc2UiLCJtcDRGaWxlIiwic3VjYyIsInRyYWNrcyIsImJhc2VUaW1lIiwic2V0Rmx2IiwidWludDgiLCJzZWVrIiwibXA0SW5pdCIsIm9uSW5pdFNlZ21lbnQiLCJvbk1lZGlhU2VnbWVudCIsInNlZWtDYWxsQmFjayIsIm9uTWVkaWFJbmZvIiwic2V0Zmx2IiwiYnVmZmVyIiwic2V0TG9jRmx2IiwidWluOCIsInNldGZsdmxvYyJdLCJtYXBwaW5ncyI6Ijs7QUFFQTs7Ozs7O0FBQ0E7O0FBRUEsSUFBTUEsT0FBTyx1QkFBYixDLENBTEE7O0FBTUFDLFFBQVFDLEdBQVIsQ0FBWUYsSUFBWjtBQUNBRyxPQUFPQ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pbnQ4LmJ1ZmZlciwgYmFzZVRpbWUpO1xuXG4gICAgICAgIC8vIOeUqOadpeiOt+WPlm1vb3ZcblxuICAgIH0sXG4gICAgc2V0TG9jRmx2KHVpbjgpIHtcbiAgICAgICAgcmV0dXJuIHRlbXAuc2V0Zmx2bG9jKHVpbjgpO1xuICAgIH1cbn07XG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vanMvZmx2RW50ZXIuanMiXSwic291cmNlUm9vdCI6IiJ9");
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/* eslint-disable */\nfunction decodeUTF8(uint8array) {\n var out = [];\n var input = uint8array;\n var i = 0;\n var length = uint8array.length;\n\n while (i < length) {\n if (input[i] < 0x80) {\n out.push(String.fromCharCode(input[i]));\n ++i;\n continue;\n } else if (input[i] < 0xC0) {\n // fallthrough\n } else if (input[i] < 0xE0) {\n if (checkContinuation(input, i, 1)) {\n var ucs4 = (input[i] & 0x1F) << 6 | input[i + 1] & 0x3F;\n if (ucs4 >= 0x80) {\n out.push(String.fromCharCode(ucs4 & 0xFFFF));\n i += 2;\n continue;\n }\n }\n } else if (input[i] < 0xF0) {\n if (checkContinuation(input, i, 2)) {\n var _ucs = (input[i] & 0xF) << 12 | (input[i + 1] & 0x3F) << 6 | input[i + 2] & 0x3F;\n if (_ucs >= 0x800 && (_ucs & 0xF800) !== 0xD800) {\n out.push(String.fromCharCode(_ucs & 0xFFFF));\n i += 3;\n continue;\n }\n }\n } else if (input[i] < 0xF8) {\n if (checkContinuation(input, i, 3)) {\n var _ucs2 = (input[i] & 0x7) << 18 | (input[i + 1] & 0x3F) << 12 | (input[i + 2] & 0x3F) << 6 | input[i + 3] & 0x3F;\n if (_ucs2 > 0x10000 && _ucs2 < 0x110000) {\n _ucs2 -= 0x10000;\n out.push(String.fromCharCode(_ucs2 >>> 10 | 0xD800));\n out.push(String.fromCharCode(_ucs2 & 0x3FF | 0xDC00));\n i += 4;\n continue;\n }\n }\n }\n out.push(String.fromCharCode(0xFFFD));\n ++i;\n }\n\n return out.join('');\n}\n\nfunction checkContinuation(uint8array, start, checkLength) {\n var array = uint8array;\n if (start + checkLength < array.length) {\n while (checkLength--) {\n if ((array[++start] & 0xC0) !== 0x80) return false;\n }\n return true;\n } else {\n return false;\n }\n}\nexports.default = decodeUTF8;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9kZWNvZGVVVEY4LmpzPzQ3ZWQiXSwibmFtZXMiOlsiZGVjb2RlVVRGOCIsInVpbnQ4YXJyYXkiLCJvdXQiLCJpbnB1dCIsImkiLCJsZW5ndGgiLCJwdXNoIiwiU3RyaW5nIiwiZnJvbUNoYXJDb2RlIiwiY2hlY2tDb250aW51YXRpb24iLCJ1Y3M0Iiwiam9pbiIsInN0YXJ0IiwiY2hlY2tMZW5ndGgiLCJhcnJheSJdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQTtBQUNBLFNBQVNBLFVBQVQsQ0FBb0JDLFVBQXBCLEVBQWdDO0FBQzVCLFFBQU1DLE1BQU0sRUFBWjtBQUNBLFFBQU1DLFFBQVFGLFVBQWQ7QUFDQSxRQUFJRyxJQUFJLENBQVI7QUFDQSxRQUFNQyxTQUFTSixXQUFXSSxNQUExQjs7QUFFQSxXQUFPRCxJQUFJQyxNQUFYLEVBQW1CO0FBQ2YsWUFBSUYsTUFBTUMsQ0FBTixJQUFXLElBQWYsRUFBcUI7QUFDakJGLGdCQUFJSSxJQUFKLENBQVNDLE9BQU9DLFlBQVAsQ0FBb0JMLE1BQU1DLENBQU4sQ0FBcEIsQ0FBVDtBQUNBLGNBQUVBLENBQUY7QUFDQTtBQUNILFNBSkQsTUFJTyxJQUFJRCxNQUFNQyxDQUFOLElBQVcsSUFBZixFQUFxQjtBQUN4QjtBQUNILFNBRk0sTUFF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gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGlucHV0W2ldIDwgMHhGMCkge1xuICAgICAgICAgICAgaWYgKGNoZWNrQ29udGludWF0aW9uKGlucHV0LCBpLCAyKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHVjczQgPSAoaW5wdXRbaV0gJiAweEYpIDw8IDEyIHwgKGlucHV0W2kgKyAxXSAmIDB4M0YpIDw8IDYgfCBpbnB1dFtpICsgMl0gJiAweDNGO1xuICAgICAgICAgICAgICAgIGlmICh1Y3M0ID49IDB4ODAwICYmICh1Y3M0ICYgMHhGODAwKSAhPT0gMHhEODAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG91dC5wdXNoKFN0cmluZy5mcm9tQ2hhckNvZGUodWNzNCAmIDB4RkZGRikpO1xuICAgICAgICAgICAgICAgICAgICBpICs9IDM7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChpbnB1dFtpXSA8IDB4RjgpIHtcbiAgICAgICAgICAgIGlmIChjaGVja0NvbnRpbnVhdGlvbihpbnB1dCwgaSwgMykpIHtcbiAgICAgICAgICAgICAgICBsZXQgdWNzNCA9IChpbnB1dFtpXSAmIDB4NykgPDwgMTggfCAoaW5wdXRbaSArIDFdICYgMHgzRikgPDwgMTIgfFxuICAgICAgICAgICAgICAgICAgICAoaW5wdXRbaSArIDJdICYgMHgzRikgPDwgNiB8IChpbnB1dFtpICsgM10gJiAweDNGKTtcbiAgICAgICAgICAgICAgICBpZiAodWNzNCA+IDB4MTAwMDAgJiYgdWNzNCA8IDB4MTEwMDAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHVjczQgLT0gMHgxMDAwMDtcbiAgICAgICAgICAgICAgICAgICAgb3V0LnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZSgodWNzNCA+Pj4gMTApIHwgMHhEODAwKSk7XG4gICAgICAgICAgICAgICAgICAgIG91dC5wdXNoKFN0cmluZy5mcm9tQ2hhckNvZGUoKHVjczQgJiAweDNGRikgfCAweERDMDApKTtcbiAgICAgICAgICAgICAgICAgICAgaSArPSA0O1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgb3V0LnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZSgweEZGRkQpKTtcbiAgICAgICAgKytpO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQuam9pbignJyk7XG59XG5cbmZ1bmN0aW9uIGNoZWNrQ29udGludWF0aW9uKHVpbnQ4YXJyYXksIHN0YXJ0LCBjaGVja0xlbmd0aCkge1xuICAgIGxldCBhcnJheSA9IHVpbnQ4YXJyYXk7XG4gICAgaWYgKHN0YXJ0ICsgY2hlY2tMZW5ndGggPCBhcnJheS5sZW5ndGgpIHtcbiAgICAgICAgd2hpbGUgKGNoZWNrTGVuZ3RoLS0pIHtcbiAgICAgICAgICAgIGlmICgoYXJyYXlbKytzdGFydF0gJiAweEMwKSAhPT0gMHg4MClcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbn1cbmV4cG9ydCBkZWZhdWx0IGRlY29kZVVURjg7XG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vanMvZGVjb2RlVVRGOC5qcyJdLCJzb3VyY2VSb290IjoiIn0=");
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * Copyright (C) 2016 Bilibili. All Rights Reserved.\n *\n * @author zheng qian <[email protected]>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable */\n// Exponential-Golomb buffer decoder\nvar ExpGolomb = function () {\n function ExpGolomb(uint8array) {\n _classCallCheck(this, ExpGolomb);\n\n this.TAG = this.constructor.name;\n\n this._buffer = uint8array;\n this._buffer_index = 0;\n this._total_bytes = uint8array.byteLength;\n this._total_bits = uint8array.byteLength * 8;\n this._current_word = 0;\n this._current_word_bits_left = 0;\n }\n\n _createClass(ExpGolomb, [{\n key: 'destroy',\n value: function destroy() {\n this._buffer = null;\n }\n }, {\n key: '_fillCurrentWord',\n value: function _fillCurrentWord() {\n var buffer_bytes_left = this._total_bytes - this._buffer_index;\n if (buffer_bytes_left <= 0) {\n throw new IllegalStateException('ExpGolomb: _fillCurrentWord() but no bytes available');\n }\n\n var bytes_read = Math.min(4, buffer_bytes_left);\n var word = new Uint8Array(4);\n word.set(this._buffer.subarray(this._buffer_index, this._buffer_index + bytes_read));\n this._current_word = new DataView(word.buffer).getUint32(0, false);\n\n this._buffer_index += bytes_read;\n this._current_word_bits_left = bytes_read * 8;\n }\n }, {\n key: 'readBits',\n value: function readBits(bits) {\n if (bits > 32) {\n throw new InvalidArgumentException('ExpGolomb: readBits() bits exceeded max 32bits!');\n }\n\n if (bits <= this._current_word_bits_left) {\n var _result = this._current_word >>> 32 - bits;\n this._current_word <<= bits;\n this._current_word_bits_left -= bits;\n return _result;\n }\n\n var result = this._current_word_bits_left ? this._current_word : 0;\n result = result >>> 32 - this._current_word_bits_left;\n var bits_need_left = bits - this._current_word_bits_left;\n\n this._fillCurrentWord();\n var bits_read_next = Math.min(bits_need_left, this._current_word_bits_left);\n\n var result2 = this._current_word >>> 32 - bits_read_next;\n this._current_word <<= bits_read_next;\n this._current_word_bits_left -= bits_read_next;\n\n result = result << bits_read_next | result2;\n return result;\n }\n }, {\n key: 'readBool',\n value: function readBool() {\n return this.readBits(1) === 1;\n }\n }, {\n key: 'readByte',\n value: function readByte() {\n return this.readBits(8);\n }\n }, {\n key: '_skipLeadingZero',\n value: function _skipLeadingZero() {\n var zero_count = void 0;\n for (zero_count = 0; zero_count < this._current_word_bits_left; zero_count++) {\n if ((this._current_word & 0x80000000 >>> zero_count) !== 0) {\n this._current_word <<= zero_count;\n this._current_word_bits_left -= zero_count;\n return zero_count;\n }\n }\n this._fillCurrentWord();\n return zero_count + this._skipLeadingZero();\n }\n }, {\n key: 'readUEG',\n value: function readUEG() {\n // unsigned exponential golomb\n var leading_zeros = this._skipLeadingZero();\n return this.readBits(leading_zeros + 1) - 1;\n }\n }, {\n key: 'readSEG',\n value: function readSEG() {\n // signed exponential golomb\n var value = this.readUEG();\n if (value & 0x01) {\n return value + 1 >>> 1;\n } else {\n return -1 * (value >>> 1);\n }\n }\n }]);\n\n return ExpGolomb;\n}();\n\nexports.default = ExpGolomb;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9mbHYvZXhwLWdvbG9tYi5qcz8zY2M5Il0sIm5hbWVzIjpbIkV4cEdvbG9tYiIsInVpbnQ4YXJyYXkiL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pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucmVhZEJpdHMoOCk7XG4gICAgfVxuXG4gICAgX3NraXBMZWFkaW5nWmVybygpIHtcbiAgICAgICAgbGV0IHplcm9fY291bnQ7XG4gICAgICAgIGZvciAoemVyb19jb3VudCA9IDA7IHplcm9fY291bnQgPCB0aGlzLl9jdXJyZW50X3dvcmRfYml0c19sZWZ0OyB6ZXJvX2NvdW50KyspIHtcbiAgICAgICAgICAgIGlmICgodGhpcy5fY3VycmVudF93b3JkICYgKDB4ODAwMDAwMDAgPj4+IHplcm9fY291bnQpKSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRfd29yZCA8PD0gemVyb19jb3VudDtcbiAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50X3dvcmRfYml0c19sZWZ0IC09IHplcm9fY291bnQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHplcm9fY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fZmlsbEN1cnJlbnRXb3JkKCk7XG4gICAgICAgIHJldHVybiB6ZXJvX2NvdW50ICsgdGhpcy5fc2tpcExlYWRpbmdaZXJvKCk7XG4gICAgfVxuXG4gICAgcmVhZFVFRygpIHsgLy8gdW5zaWduZWQgZXhwb25lbnRpYWwgZ29sb21iXG4gICAgICAgIGNvbnN0IGxlYWRpbmdfemVyb3MgPSB0aGlzLl9za2lwTGVhZGluZ1plcm8oKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucmVhZEJpdHMobGVhZGluZ196ZXJvcyArIDEpIC0gMTtcbiAgICB9XG5cbiAgICByZWFkU0VHKCkgeyAvLyBzaWduZWQgZXhwb25lbnRpYWwgZ29sb21iXG4gICAgICAgIGNvbnN0IHZhbHVlID0gdGhpcy5yZWFkVUVHKCk7XG4gICAgICAgIGlmICh2YWx1ZSAmIDB4MDEpIHtcbiAgICAgICAgICAgIHJldHVybiAodmFsdWUgKyAxKSA+Pj4gMTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiAtMSAqICh2YWx1ZSA+Pj4gMSk7XG4gICAgICAgIH1cbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgRXhwR29sb21iO1xuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2pzL2Zsdi9leHAtZ29sb21iLmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable */\n\n\nvar _flvTag = __webpack_require__(7);\n\nvar _flvTag2 = _interopRequireDefault(_flvTag);\n\nvar _tagdemux = __webpack_require__(1);\n\nvar _tagdemux2 = _interopRequireDefault(_tagdemux);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FlvParse = function () {\n function FlvParse() {\n _classCallCheck(this, FlvParse);\n\n this.tempUint8 = new Uint8Array();\n this.arrTag = [];\n this.index = 0;\n this.tempArr = [];\n this.stop = false;\n this.offset = 0;\n this.frist = true;\n this._hasAudio = false;\n this._hasVideo = false;\n }\n\n /**\n * 接受 外部的flv二进制数据\n */\n\n\n _createClass(FlvParse, [{\n key: 'setFlv',\n value: function setFlv(uint8) {\n this.stop = false;\n this.arrTag = [];\n this.index = 0;\n this.tempUint8 = uint8;\n if (this.tempUint8.length > 13 && this.tempUint8[0] == 70 && this.tempUint8[1] == 76 && this.tempUint8[2] == 86) {\n this.probe(this.tempUint8.buffer);\n this.read(9); // 略掉9个字节的flv header tag\n this.read(4); // 略掉第一个4字节的 tag size\n this.parse();\n this.frist = false;\n return this.offset;\n } else if (!this.frist) {\n return this.parse();\n } else {\n return this.offset;\n }\n }\n }, {\n key: 'probe',\n value: function probe(buffer) {\n var data = new Uint8Array(buffer);\n var mismatch = { match: false };\n\n if (data[0] !== 0x46 || data[1] !== 0x4C || data[2] !== 0x56 || data[3] !== 0x01) {\n return mismatch;\n }\n\n var hasAudio = (data[4] & 4) >>> 2 !== 0;\n var hasVideo = (data[4] & 1) !== 0;\n\n if (!hasAudio && !hasVideo) {\n return mismatch;\n }\n this._hasAudio = _tagdemux2.default._hasAudio = hasAudio;\n this._hasVideo = _tagdemux2.default._hasVideo = hasVideo;\n return {\n match: true,\n hasAudioTrack: hasAudio,\n hasVideoTrack: hasVideo\n };\n }\n\n /**\n * 开始解析\n */\n\n }, {\n key: 'parse',\n value: function parse() {\n\n while (this.index < this.tempUint8.length && !this.stop) {\n this.offset = this.index;\n\n var t = new _flvTag2.default();\n if (this.tempUint8.length - this.index >= 11) {\n t.tagType = this.read(1)[0]; // 取出tag类型\n t.dataSize = this.read(3); // 取出包体大小\n t.Timestamp = this.read(4); // 取出解码时间\n t.StreamID = this.read(3); // 取出stream id\n } else {\n this.stop = true;\n continue;\n }\n if (this.tempUint8.length - this.index >= this.getBodySum(t.dataSize) + 4) {\n t.body = this.read(this.getBodySum(t.dataSize)); // 取出body\n if (t.tagType == 9 && this._hasVideo) {\n this.arrTag.push(t);\n }\n if (t.tagType == 8 && this._hasAudio) {\n this.arrTag.push(t);\n }\n if (t.tagType == 18) {\n if (this.arrTag.length == 0) this.arrTag.push(t);else {\n console.log('这是截获的自定义数据', t);\n }\n }\n t.size = this.read(4);\n } else {\n this.stop = true;\n continue;\n }\n this.offset = this.index;\n }\n\n return this.offset;\n }\n }, {\n key: 'read',\n value: function read(length) {\n // let u8a = new Uint8Array(length);\n // u8a.set(this.tempUint8.subarray(this.index, this.index + length), 0);\n var u8a = this.tempUint8.slice(this.index, this.index + length);\n this.index += length;\n return u8a;\n }\n\n /**\n * 计算tag包体大小\n */\n\n }, {\n key: 'getBodySum',\n value: function getBodySum(arr) {\n var _str = '';\n _str += arr[0].toString(16).length == 1 ? '0' + arr[0].toString(16) : arr[0].toString(16);\n _str += arr[1].toString(16).length == 1 ? '0' + arr[1].toString(16) : arr[1].toString(16);\n _str += arr[2].toString(16).length == 1 ? '0' + arr[2].toString(16) : arr[2].toString(16);\n return parseInt(_str, 16);\n }\n }]);\n\n return FlvParse;\n}();\n\nexports.default = new FlvParse();//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9mbHYvZmx2UGFyc2UuanM/Y2FlOCJdLCJuYW1lcyI6WyJGbHZQYXJzZSIsInRlbXBVaW50OCIsIlVpbnQ4QXJyYXkiLCJhcnJUYWciLCJpbmRleCIsInRlbXBBcnIiLCJzdG9wIiwib2Zmc2V0IiwiZnJpc3QiLCJfaGFzQXVkaW8iLCJfaGFzVmlkZW8iLCJ1aW50OCIsImxlbmd0aCIsInByb2JlIiwiYnVmZmVyIiwicmVhZCIsInBhcnNlIiwiZGF0YSIsIm1pc21hdGNoIiwibWF0Y2giLCJoYXNBdWRpbyIsImhhc1ZpZGVvIiwiaGFzQXVkaW9UcmFjayIsImhhc1ZpZGVvVHJhY2siLCJ0IiwidGFnVHlwZSIsImRhdGFTaXplIiwiVGltZXN0YW1wIiwiU3RyZWFtSUQiLCJnZXRCb2R5U3VtIiwiYm9keSIsInB1c2giLCJjb25zb2xlIiwibG9nIiwic2l6ZSIsInU4YSIsInNsaWNlIiwiYXJyIiwiX3N0ciIsInRvU3RyaW5nIiwicGFyc2VJbnQiXSwibWFwcGluZ3MiOiI7Oz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bHNlO1xuICAgICAgICB0aGlzLm9mZnNldCA9IDA7XG4gICAgICAgIHRoaXMuZnJpc3QgPSB0cnVlO1xuICAgICAgICB0aGlzLl9oYXNBdWRpbyA9IGZhbHNlO1xuICAgICAgICB0aGlzLl9oYXNWaWRlbyA9IGZhbHNlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIOaOpeWPlyDlpJbpg6jnmoRmbHbkuozov5vliLbmlbDmja5cbiAgICAgKi9cbiAgICBzZXRGbHYodWludDgpIHtcbiAgICAgICAgdGhpcy5zdG9wID0gZmFsc2U7XG4gICAgICAgIHRoaXMuYXJyVGFnID0gW107XG4gICAgICAgIHRoaXMuaW5kZXggPSAwO1xuICAgICAgICB0aGlzLnRlbXBVaW50OCA9IHVpbnQ4O1xuICAgICAgICBpZiAodGhpcy50ZW1wVWludDgubGVuZ3RoID4gMTMgJiYgdGhpcy50ZW1wVWludDhbMF0gPT0gNzAgJiYgdGhpcy50ZW1wVWludDhbMV0gPT0gNzYgJiYgdGhpcy50ZW1wVWludDhbMl0gPT0gODYpIHtcbiAgICAgICAgICAgIHRoaXMucHJvYmUodGhpcy50ZW1wVWludDguYnVmZmVyKTtcbiAgICAgICAgICAgIHRoaXMucmVhZCg5KTsgLy8g55Wl5o6JOeS4quWtl+iKgueahGZsdiBoZWFkZXIgdGFnXG4gICAgICAgICAgICB0aGlzLnJlYWQoNCk7IC8vIOeVpeaOieesrOS4gOS4qjTlrZfoioLnmoQgdGFnIHNpemVcbiAgICAgICAgICAgIHRoaXMucGFyc2UoKTtcbiAgICAgICAgICAgIHRoaXMuZnJpc3QgPSBmYWxzZTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9mZnNldDtcbiAgICAgICAgfSBlbHNlIGlmICghdGhpcy5mcmlzdCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2UoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9mZnNldDtcbiAgICAgIC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zLm9mZnNldCA9IHRoaXMuaW5kZXg7XG5cbiAgICAgICAgICAgIGNvbnN0IHQgPSBuZXcgdGFnKCk7XG4gICAgICAgICAgICBpZiAodGhpcy50ZW1wVWludDgubGVuZ3RoIC0gdGhpcy5pbmRleCA+PSAxMSkge1xuICAgICAgICAgICAgICAgIHQudGFnVHlwZSA9ICh0aGlzLnJlYWQoMSlbMF0pOyAvLyDlj5blh7p0YWfnsbvlnotcbiAgICAgICAgICAgICAgICB0LmRhdGFTaXplID0gdGhpcy5yZWFkKDMpOyAvLyDlj5blh7rljIXkvZPlpKflsI9cbiAgICAgICAgICAgICAgICB0LlRpbWVzdGFtcCA9IHRoaXMucmVhZCg0KTsgLy8g5Y+W5Ye66Kej56CB5pe26Ze0XG4gICAgICAgICAgICAgICAgdC5TdHJlYW1JRCA9IHRoaXMucmVhZCgzKTsgLy8g5Y+W5Ye6c3RyZWFtIGlkXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuc3RvcCA9IHRydWU7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGhpcy50ZW1wVWludDgubGVuZ3RoIC0gdGhpcy5pbmRleCA+PSAodGhpcy5nZXRCb2R5U3VtKHQuZGF0YVNpemUpICsgNCkpIHtcbiAgICAgICAgICAgICAgICB0LmJvZHkgPSB0aGlzLnJlYWQodGhpcy5nZXRCb2R5U3VtKHQuZGF0YVNpemUpKTsgLy8g5Y+W5Ye6Ym9keVxuICAgICAgICAgICAgICAgIGlmICh0LnRhZ1R5cGUgPT0gOSAmJiB0aGlzLl9oYXNWaWRlbykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFyclRhZy5wdXNoKHQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodC50YWdUeXBlID09IDggJiYgdGhpcy5faGFzQXVkaW8pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hcnJUYWcucHVzaCh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHQudGFnVHlwZSA9PSAxOCApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5hcnJUYWcubGVuZ3RoPT0wKVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmFyclRhZy5wdXNoKHQpO1xuICAgICAgICAgICAgICAgICAgICBlbHNle1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+i/meaYr+aIquiOt+eahOiHquWumuS5ieaVsOaNricsdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdC5zaXplPXRoaXMucmVhZCg0KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdG9wID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMub2Zmc2V0ID0gdGhpcy5pbmRleDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLm9mZnNldDtcbiAgICB9XG4gICAgcmVhZChsZW5ndGgpIHtcbiAgICAgICAgLy8gbGV0IHU4YSA9IG5ldyBVaW50OEFycmF5KGxlbmd0aCk7XG4gICAgICAgIC8vIHU4YS5zZXQodGhpcy50ZW1wVWludDguc3ViYXJyYXkodGhpcy5pbmRleCwgdGhpcy5pbmRleCArIGxlbmd0aCksIDApO1xuICAgICAgICBjb25zdCB1OGEgPSB0aGlzLnRlbXBVaW50OC5zbGljZSh0aGlzLmluZGV4LCB0aGlzLmluZGV4ICsgbGVuZ3RoKTtcbiAgICAgICAgdGhpcy5pbmRleCArPSBsZW5ndGg7XG4gICAgICAgIHJldHVybiB1OGE7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICog6K6h566XdGFn5YyF5L2T5aSn5bCPXG4gICAgICovXG4gICAgZ2V0Qm9keVN1bShhcnIpIHtcbiAgICAgICAgbGV0IF9zdHIgPSAnJztcbiAgICAgICAgX3N0ciArPSAoYXJyWzBdLnRvU3RyaW5nKDE2KS5sZW5ndGggPT0gMSA/ICcwJyArIGFyclswXS50b1N0cmluZygxNikgOiBhcnJbMF0udG9TdHJpbmcoMTYpKTtcbiAgICAgICAgX3N0ciArPSAoYXJyWzFdLnRvU3RyaW5nKDE2KS5sZW5ndGggPT0gMSA/ICcwJyArIGFyclsxXS50b1N0cmluZygxNikgOiBhcnJbMV0udG9TdHJpbmcoMTYpKTtcbiAgICAgICAgX3N0ciArPSAoYXJyWzJdLnRvU3RyaW5nKDE2KS5sZW5ndGggPT0gMSA/ICcwJyArIGFyclsyXS50b1N0cmluZygxNikgOiBhcnJbMl0udG9TdHJpbmcoMTYpKTtcbiAgICAgICAgcmV0dXJuIHBhcnNlSW50KF9zdHIsIDE2KTtcbiAgICB9XG59XG5leHBvcnQgZGVmYXVsdCBuZXcgRmx2UGFyc2UoKTtcblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9qcy9mbHYvZmx2UGFyc2UuanMiXSwic291cmNlUm9vdCI6IiJ9");
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-disable */\nvar FlvTag = function () {\n function FlvTag() {\n _classCallCheck(this, FlvTag);\n\n this.tagType = -1;\n this.dataSize = -1;\n this.Timestamp = -1;\n this.StreamID = -1;\n this.body = -1;\n this.time = -1;\n this.arr = [];\n this.size = -1;\n }\n\n _createClass(FlvTag, [{\n key: 'getTime',\n value: function getTime() {\n // this.Timestamp.pop();\n this.arr = [];\n for (var i = 0; i < this.Timestamp.length; i++) {\n this.arr.push(this.Timestamp[i].toString(16).length == 1 ? '0' + this.Timestamp[i].toString(16) : this.Timestamp[i].toString(16));\n }\n this.arr.pop();\n var time = this.arr.join('');\n this.time = parseInt(time, 16);\n return parseInt(time, 16);\n }\n }]);\n\n return FlvTag;\n}();\n\nexports.default = FlvTag;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9mbHYvZmx2VGFnLmpzPzg1OTgiXSwibmFtZXMiOlsiRmx2VGFnIiwidGFnVHlwZSIsImRhdGFTaXplIiwiVGltZXN0YW1wIiwiU3RyZWFtSUQiLCJib2R5IiwidGltZSIsImFyciIsInNpemUiLCJpIiwibGVuZ3RoIiwicHVzaCIsInRvU3RyaW5nIiwicG9wIiwiam9pbiIsInBhcnNlSW50Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUE7SUFDcUJBLE07QUFDakIsc0JBQWM7QUFBQTs7QUFDVixhQUFLQyxPQUFMLEdBQWUsQ0FBQyxDQUFoQjtBQUNBLGFBQUtDLFFBQUwsR0FBZ0IsQ0FBQyxDQUFqQjtBQUNBLGFBQUtDLFNBQUwsR0FBaUIsQ0FBQyxDQUFsQjtBQUNBLGFBQUtDLFFBQUwsR0FBZ0IsQ0FBQyxDQUFqQjtBQUNBLGFBQUtDLElBQUwsR0FBWSxDQUFDLENBQWI7QUFDQSxhQUFLQyxJQUFMLEdBQVksQ0FBQyxDQUFiO0FBQ0EsYUFBS0MsR0FBTCxHQUFXLEVBQVg7QUFDQSxhQUFLQyxJQUFMLEdBQVUsQ0FBQyxDQU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C0xO1xuICAgICAgICB0aGlzLnRpbWUgPSAtMTtcbiAgICAgICAgdGhpcy5hcnIgPSBbXTtcbiAgICAgICAgdGhpcy5zaXplPS0xO1xuICAgIH1cbiAgICBnZXRUaW1lKCkge1xuICAgICAgICAvLyB0aGlzLlRpbWVzdGFtcC5wb3AoKTtcbiAgICAgICAgdGhpcy5hcnIgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLlRpbWVzdGFtcC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdGhpcy5hcnIucHVzaCgodGhpcy5UaW1lc3RhbXBbaV0udG9TdHJpbmcoMTYpLmxlbmd0aCA9PSAxID8gJzAnICsgdGhpcy5UaW1lc3RhbXBbaV0udG9TdHJpbmcoMTYpIDogdGhpcy5UaW1lc3RhbXBbaV0udG9TdHJpbmcoMTYpKSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5hcnIucG9wKCk7XG4gICAgICAgIGNvbnN0IHRpbWUgPSB0aGlzLmFyci5qb2luKCcnKTtcbiAgICAgICAgdGhpcy50aW1lID0gcGFyc2VJbnQodGltZSwgMTYpO1xuICAgICAgICByZXR1cm4gcGFyc2VJbnQodGltZSwgMTYpO1xuICAgIH1cbn1cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9qcy9mbHYvZmx2VGFnLmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable */\n\n\nvar _decodeUTF = __webpack_require__(4);\n\nvar _decodeUTF2 = _interopRequireDefault(_decodeUTF);\n\nvar _spsParser = __webpack_require__(0);\n\nvar _spsParser2 = _interopRequireDefault(_spsParser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar le = function () {\n var buf = new ArrayBuffer(2);\n new DataView(buf).setInt16(0, 256, true); // little-endian write\n return new Int16Array(buf)[0] === 256; // platform-spec read, if equal then LE\n}();\n\nvar flvDemux = function () {\n function flvDemux() {\n _classCallCheck(this, flvDemux);\n }\n\n _createClass(flvDemux, null, [{\n key: 'parseObject',\n value: function parseObject(arrayBuffer, dataOffset, dataSize) {\n\n var name = flvDemux.parseString(arrayBuffer, dataOffset, dataSize);\n var value = flvDemux.parseScript(arrayBuffer, dataOffset + name.size);\n var isObjectEnd = value.objectEnd;\n\n return {\n data: {\n name: name.data,\n value: value.data\n },\n size: value.size,\n objectEnd: isObjectEnd\n };\n }\n }, {\n key: 'parseVariable',\n value: function parseVariable(arrayBuffer, dataOffset, dataSize) {\n return flvDemux.parseObject(arrayBuffer, dataOffset, dataSize);\n }\n }, {\n key: 'parseLongString',\n value: function parseLongString(arrayBuffer, dataOffset, dataSize) {\n\n var v = new DataView(arrayBuffer, dataOffset);\n var length = v.getUint32(0, !le);\n\n var str = void 0;\n if (length > 0) {\n str = (0, _decodeUTF2.default)(new Uint8Array(arrayBuffer, dataOffset + 4, length));\n } else {\n str = '';\n }\n\n return {\n data: str,\n size: 4 + length\n };\n }\n }, {\n key: 'parseDate',\n value: function parseDate(arrayBuffer, dataOffset, dataSize) {\n\n var v = new DataView(arrayBuffer, dataOffset);\n var timestamp = v.getFloat64(0, !le);\n var localTimeOffset = v.getInt16(8, !le);\n timestamp += localTimeOffset * 60 * 1000; // get UTC time\n\n return {\n data: new Date(timestamp),\n size: 8 + 2\n };\n }\n }, {\n key: 'parseString',\n value: function parseString(arrayBuffer, dataOffset, dataSize) {\n var v = new DataView(arrayBuffer, dataOffset);\n var length = v.getUint16(0, !le);\n var str = void 0;\n if (length > 0) {\n str = (0, _decodeUTF2.default)(new Uint8Array(arrayBuffer, dataOffset + 2, length));\n } else {\n str = '';\n }\n return {\n data: str,\n size: 2 + length\n };\n }\n\n /**\n * 解析metadata\n */\n\n }, {\n key: 'parseMetadata',\n value: function parseMetadata(arr) {\n var name = flvDemux.parseScript(arr, 0);\n var value = flvDemux.parseScript(arr, name.size, arr.length - name.size);\n // return {}\n var data = {};\n data[name.data] = value.data;\n return data;\n }\n }, {\n key: 'parseScript',\n value: function parseScript(arr, offset, dataSize) {\n var dataOffset = offset;\n var object = {};\n var uint8 = new Uint8Array(arr);\n var buffer = uint8.buffer;\n var dv = new DataView(buffer, 0, dataSize);\n var value = null;\n var objectEnd = false;\n var type = dv.getUint8(dataOffset);\n dataOffset += 1;\n\n switch (type) {\n case 0:\n // Number(Double) type\n value = dv.getFloat64(dataOffset, !le);\n dataOffset += 8;\n break;\n case 1:\n {\n // Boolean type\n var b = dv.getUint8(dataOffset);\n value = !!b;\n dataOffset += 1;\n break;\n }\n case 2:\n {\n // String type\n // dataOffset += 1;\n var amfstr = flvDemux.parseString(buffer, dataOffset);\n value = amfstr.data;\n dataOffset += amfstr.size;\n break;\n }\n case 3:\n\n {\n // Object(s) type\n value = {};\n var terminal = 0; // workaround for malformed Objects which has missing ScriptDataObjectEnd\n if ((dv.getUint32(dataSize - 4, !le) & 0x00FFFFFF) === 9) {\n terminal = 3;\n }\n while (dataOffset < dataSize - 4) {\n // 4 === type(UI8) + ScriptDataObjectEnd(UI24)\n var amfobj = flvDemux.parseObject(buffer, dataOffset, dataSize - offset - terminal);\n\n if (amfobj.objectEnd) {\n break;\n }\n value[amfobj.data.name] = amfobj.data.value;\n // dataOffset += amfobj.size;\n dataOffset = amfobj.size;\n }\n if (dataOffset <= dataSize - 3) {\n var marker = v.getUint32(dataOffset - 1, !le) & 0x00FFFFFF;\n if (marker === 9) {\n dataOffset += 3;\n }\n }\n break;\n }\n case 8:\n {\n // ECMA array type (Mixed array)\n value = {};\n // dataOffset += 1;\n dataOffset += 4; // ECMAArrayLength(UI32)\n var _terminal = 0; // workaround for malformed MixedArrays which has missing ScriptDataObjectEnd\n if ((dv.getUint32(dataSize - 4, !le) & 0x00FFFFFF) === 9) {\n _terminal = 3;\n }\n while (dataOffset < dataSize - 8) {\n // 8 === type(UI8) + ECMAArrayLength(UI32) + ScriptDataVariableEnd(UI24)\n var amfvar = flvDemux.parseVariable(buffer, dataOffset);\n\n if (amfvar.objectEnd) {\n break;\n }\n value[amfvar.data.name] = amfvar.data.value;\n dataOffset = amfvar.size;\n }\n if (dataOffset <= dataSize - 3) {\n var _marker = dv.getUint32(dataOffset - 1, !le) & 0x00FFFFFF;\n if (_marker === 9) {\n dataOffset += 3;\n }\n }\n break;\n }\n case 9:\n // ScriptDataObjectEnd\n value = undefined;\n dataOffset = 1;\n objectEnd = true;\n break;\n case 10:\n {\n // Strict array type\n // ScriptDataValue[n]. NOTE: according to video_file_format_spec_v10_1.pdf\n value = [];\n var strictArrayLength = dv.getUint32(dataOffset, !le);\n dataOffset += 4;\n for (var i = 0; i < strictArrayLength; i++) {\n var val = flvDemux.parseScript(buffer, dataOffset);\n value.push(val.data);\n dataOffset = val.size;\n }\n break;\n }\n case 11:\n {\n // Date type\n var date = flvDemux.parseDate(buffer, dataOffset + 1, dataSize - 1);\n value = date.data;\n dataOffset += date.size;\n break;\n }\n case 12:\n {\n // Long string type\n var amfLongStr = flvDemux.parseString(buffer, dataOffset + 1, dataSize - 1);\n value = amfLongStr.data;\n dataOffset += amfLongStr.size;\n break;\n }\n default:\n // ignore and skip\n dataOffset = dataSize;\n console.log('AMF', 'Unsupported AMF value type ' + type);\n }\n return {\n data: value,\n size: dataOffset\n };\n }\n }]);\n\n return flvDemux;\n}();\n\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bmQgPSBmYWxzZTtcbiAgICAgICAgY29uc3QgdHlwZSA9IChkdi5nZXRVaW50OChkYXRhT2Zmc2V0KSk7XG4gICAgICAgIGRhdGFPZmZzZXQgKz0gMTtcblxuICAgICAgICBzd2l0Y2ggKHR5cGUpIHtcbiAgICAgICAgICAgIGNhc2UgMDogLy8gTnVtYmVyKERvdWJsZSkgdHlwZVxuICAgICAgICAgICAgICAgIHZhbHVlID0gZHYuZ2V0RmxvYXQ2NChkYXRhT2Zmc2V0LCAhbGUpO1xuICAgICAgICAgICAgICAgIGRhdGFPZmZzZXQgKz0gODtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICB7IC8vIEJvb2xlYW4gdHlwZVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBiID0gZHYuZ2V0VWludDgoZGF0YU9mZnNldCk7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gISFiO1xuICAgICAgICAgICAgICAgICAgICBkYXRhT2Zmc2V0ICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICB7IC8vIFN0cmluZyB0eXBlXG4gICAgICAgICAgICAgICAgICAgIC8vIGRhdGFPZmZzZXQgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgYW1mc3RyID0gZmx2RGVtdXgucGFyc2VTdHJpbmcoYnVmZmVyLCBkYXRhT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBhbWZzdHIuZGF0YTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldCArPSBhbWZzdHIuc2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSAzOlxuXG4gICAgICAgICAgICAgICAgeyAvLyBPYmplY3QocykgdHlwZVxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICBsZXQgdGVybWluYWwgPSAwOyAvLyB3b3JrYXJvdW5kIGZvciBtYWxmb3JtZWQgT2JqZWN0cyB3aGljaCBoYXMgbWlzc2luZyBTY3JpcHREYXRhT2JqZWN0RW5kXG4gICAgICAgICAgICAgICAgICAgIGlmICgoZHYuZ2V0VWludDMyKGRhdGFTaXplIC0gNCwgIWxlKSAmIDB4MDBGRkZGRkYpID09PSA5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXJtaW5hbCA9IDM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGRhdGFPZmZzZXQgPCBkYXRhU2l6ZSAtIDQpIHsgLy8gNCA9PT0gdHlwZShVSTgpICsgU2NyaXB0RGF0YU9iamVjdEVuZChVSTI0KVxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYW1mb2JqID0gZmx2RGVtdXgucGFyc2VPYmplY3QoYnVmZmVyLCBkYXRhT2Zmc2V0LCBkYXRhU2l6ZSAtIG9mZnNldCAtIHRlcm1pbmFsKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFtZm9iai5vYmplY3RFbmQpIHsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2FtZm9iai5kYXRhLm5hbWVdID0gYW1mb2JqLmRhdGEudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBkYXRhT2Zmc2V0ICs9IGFtZm9iai5zaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldCA9IGFtZm9iai5zaXplO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhT2Zmc2V0IDw9IGRhdGFTaXplIC0gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWFya2VyID0gdi5nZXRVaW50MzIoZGF0YU9mZnNldCAtIDEsICFsZSkgJiAweDAwRkZGRkZGO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hcmtlciA9PT0gOSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFPZmZzZXQgKz0gMztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlIDg6XG4gICAgICAgICAgICAgICAgeyAvLyBFQ01BIGFycmF5IHR5cGUgKE1peGVkIGFycmF5KVxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAvLyBkYXRhT2Zmc2V0ICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIGRhdGFPZmZzZXQgKz0gNDsgLy8gRUNNQUFycmF5TGVuZ3RoKFVJMzIpXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZXJtaW5hbCA9IDA7IC8vIHdvcmthcm91bmQgZm9yIG1hbGZvcm1lZCBNaXhlZEFycmF5cyB3aGljaCBoYXMgbWlzc2luZyBTY3JpcHREYXRhT2JqZWN0RW5kXG4gICAgICAgICAgICAgICAgICAgIGlmICgoZHYuZ2V0VWludDMyKGRhdGFTaXplIC0gNCwgIWxlKSAmIDB4MDBGRkZGRkYpID09PSA5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXJtaW5hbCA9IDM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGRhdGFPZmZzZXQgPCBkYXRhU2l6ZSAtIDgpIHsgLy8gOCA9PT0gdHlwZShVSTgpICsgRUNNQUFycmF5TGVuZ3RoKFVJMzIpICsgU2NyaXB0RGF0YVZhcmlhYmxlRW5kKFVJMjQpXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhbWZ2YXIgPSBmbHZEZW11eC5wYXJzZVZhcmlhYmxlKGJ1ZmZlciwgZGF0YU9mZnNldCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbWZ2YXIub2JqZWN0RW5kKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVthbWZ2YXIuZGF0YS5uYW1lXSA9IGFtZnZhci5kYXRhLnZhbHVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldCA9IGFtZnZhci5zaXplO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhT2Zmc2V0IDw9IGRhdGFTaXplIC0gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWFya2VyID0gZHYuZ2V0VWludDMyKGRhdGFPZmZzZXQgLSAxLCAhbGUpICYgMHgwMEZGRkZGRjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXJrZXIgPT09IDkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhT2Zmc2V0ICs9IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSA5OiAvLyBTY3JpcHREYXRhT2JqZWN0RW5kXG4gICAgICAgICAgICAgICAgdmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgZGF0YU9mZnNldCA9IDE7XG4gICAgICAgICAgICAgICAgb2JqZWN0RW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMTA6XG4gICAgICAgICAgICAgICAgeyAvLyBTdHJpY3QgYXJyYXkgdHlwZVxuICAgICAgICAgICAgICAgICAgICAvLyBTY3JpcHREYXRhVmFsdWVbbl0uIE5PVEU6IGFjY29yZGluZyB0byB2aWRlb19maWxlX2Zvcm1hdF9zcGVjX3YxMF8xLnBkZlxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdHJpY3RBcnJheUxlbmd0aCA9IGR2LmdldFVpbnQzMihkYXRhT2Zmc2V0LCAhbGUpO1xuICAgICAgICAgICAgICAgICAgICBkYXRhT2Zmc2V0ICs9IDQ7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3RyaWN0QXJyYXlMZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsID0gZmx2RGVtdXgucGFyc2VTY3JpcHQoYnVmZmVyLCBkYXRhT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnB1c2godmFsLmRhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldCA9IHZhbC5zaXplO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgMTE6XG4gICAgICAgICAgICAgICAgeyAvLyBEYXRlIHR5cGVcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGF0ZSA9IGZsdkRlbXV4LnBhcnNlRGF0ZShidWZmZXIsIGRhdGFPZmZzZXQgKyAxLCBkYXRhU2l6ZSAtIDEpO1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGRhdGUuZGF0YTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldCArPSBkYXRlLnNpemU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgMTI6XG4gICAgICAgICAgICAgICAgeyAvLyBMb25nIHN0cmluZyB0eXBlXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGFtZkxvbmdTdHIgPSBmbHZEZW11eC5wYXJzZVN0cmluZyhidWZmZXIsIGRhdGFPZmZzZXQgKyAxLCBkYXRhU2l6ZSAtIDEpO1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGFtZkxvbmdTdHIuZGF0YTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldCArPSBhbWZMb25nU3RyLnNpemU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgLy8gaWdub3JlIGFuZCBza2lwXG4gICAgICAgICAgICAgICAgZGF0YU9mZnNldCA9IGRhdGFTaXplO1xuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdBTUYnLCAnVW5zdXBwb3J0ZWQgQU1GIHZhbHVlIHR5cGUgJyArIHR5cGUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBkYXRhOiB2YWx1ZSxcbiAgICAgICAgICAgIHNpemU6IGRhdGFPZmZzZXQsXG4gICAgICAgIH07XG4gICAgfVxufVxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2pzL2Zsdi9mbHZkZW11eC5qcyJdLCJzb3VyY2VSb290IjoiIn0=");
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * Copyright (C) 2016 Bilibili. All Rights Reserved.\n *\n * @author zheng qian <[email protected]>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable */\nvar MediaInfo = function () {\n function MediaInfo() {\n _classCallCheck(this, MediaInfo);\n\n this.mimeType = null;\n this.duration = null;\n\n this.hasAudio = null;\n this.hasVideo = null;\n this.audioCodec = null;\n this.videoCodec = null;\n this.audioDataRate = null;\n this.videoDataRate = null;\n\n this.audioSampleRate = null;\n this.audioChannelCount = null;\n\n this.width = null;\n this.height = null;\n this.fps = null;\n this.profile = null;\n this.level = null;\n this.chromaFormat = null;\n this.sarNum = null;\n this.sarDen = null;\n\n this.metadata = null;\n this.segments = null; // MediaInfo[]\n this.segmentCount = null;\n this.hasKeyframesIndex = null;\n this.keyframesIndex = null;\n }\n\n _createClass(MediaInfo, [{\n key: \"isComplete\",\n value: function isComplete() {\n var audioInfoComplete = this.hasAudio === false || this.hasAudio === true && this.audioCodec != null && this.audioSampleRate != null && this.audioChannelCount != null;\n\n var videoInfoComplete = this.hasVideo === false || this.hasVideo === true && this.videoCodec != null && this.width != null && this.height != null && this.fps != null && this.profile != null && this.level != null && this.chromaFormat != null && this.sarNum != null && this.sarDen != null;\n\n // keyframesIndex may not be present\n return this.mimeType != null && this.duration != null && this.metadata != null && this.hasKeyframesIndex != null && audioInfoComplete && videoInfoComplete;\n }\n }, {\n key: \"isSeekable\",\n value: function isSeekable() {\n return this.hasKeyframesIndex === true;\n }\n }]);\n\n return MediaInfo;\n}();\n\nexports.default = MediaInfo;//# sourceMappingURL=data:application/json;char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WxsO1xuICAgICAgICB0aGlzLnNhckRlbiA9IG51bGw7XG5cbiAgICAgICAgdGhpcy5tZXRhZGF0YSA9IG51bGw7XG4gICAgICAgIHRoaXMuc2VnbWVudHMgPSBudWxsOyAvLyBNZWRpYUluZm9bXVxuICAgICAgICB0aGlzLnNlZ21lbnRDb3VudCA9IG51bGw7XG4gICAgICAgIHRoaXMuaGFzS2V5ZnJhbWVzSW5kZXggPSBudWxsO1xuICAgICAgICB0aGlzLmtleWZyYW1lc0luZGV4ID0gbnVsbDtcbiAgICB9XG5cbiAgICBpc0NvbXBsZXRlKCkge1xuICAgICAgICBjb25zdCBhdWRpb0luZm9Db21wbGV0ZSA9ICh0aGlzLmhhc0F1ZGlvID09PSBmYWxzZSkgfHxcbiAgICAgICAgICAgICh0aGlzLmhhc0F1ZGlvID09PSB0cnVlICYmXG4gICAgICAgICAgICAgICAgdGhpcy5hdWRpb0NvZGVjICE9IG51bGwgJiZcbiAgICAgICAgICAgICAgICB0aGlzLmF1ZGlvU2FtcGxlUmF0ZSAhPSBudWxsICYmXG4gICAgICAgICAgICAgICAgdGhpcy5hdWRpb0NoYW5uZWxDb3VudCAhPSBudWxsKTtcblxuICAgICAgICBjb25zdCB2aWRlb0luZm9Db21wbGV0ZSA9ICh0aGlzLmhhc1ZpZGVvID09PSBmYWxzZSkgfHxcbiAgICAgICAgICAgICh0aGlzLmhhc1ZpZGVvID09PSB0cnVlICYmXG4gICAgICAgICAgICAgICAgdGhpcy52aWRlb0NvZGVjICE9IG51bGwgJiZcbiAgICAgICAgICAgICAgICB0aGlzLndpZHRoICE9IG51bGwgJiZcbiAgICAgICAgICAgICAgICB0aGlzLmhlaWdodCAhPSBudWxsICYmXG4gICAgICAgICAgICAgICAgdGhpcy5mcHMgIT0gbnVsbCAmJlxuICAgICAgICAgICAgICAgIHRoaXMucHJvZmlsZSAhPSBudWxsICYmXG4gICAgICAgICAgICAgICAgdGhpcy5sZXZlbCAhPSBudWxsICYmXG4gICAgICAgICAgICAgICAgdGhpcy5jaHJvbWFGb3JtYXQgIT0gbnVsbCAmJlxuICAgICAgICAgICAgICAgIHRoaXMuc2FyTnVtICE9IG51bGwgJiZcbiAgICAgICAgICAgICAgICB0aGlzLnNhckRlbiAhPSBudWxsKTtcblxuICAgICAgICAvLyBrZXlmcmFtZXNJbmRleCBtYXkgbm90IGJlIHByZXNlbnRcbiAgICAgICAgcmV0dXJuIHRoaXMubWltZVR5cGUgIT0gbnVsbCAmJlxuICAgICAgICAgICAgdGhpcy5kdXJhdGlvbiAhPSBudWxsICYmXG4gICAgICAgICAgICB0aGlzLm1ldGFkYXRhICE9IG51bGwgJiZcbiAgICAgICAgICAgIHRoaXMuaGFzS2V5ZnJhbWVzSW5kZXggIT0gbnVsbCAmJlxuICAgICAgICAgICAgYXVkaW9JbmZvQ29tcGxldGUgJiZcbiAgICAgICAgICAgIHZpZGVvSW5mb0NvbXBsZXRlO1xuICAgIH1cblxuICAgIGlzU2Vla2FibGUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmhhc0tleWZyYW1lc0luZGV4ID09PSB0cnVlO1xuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgTWVkaWFJbmZvO1xuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2pzL2Zsdi9tZWRpYS1pbmZvLmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable */\n\n\nvar _flvParse = __webpack_require__(6);\n\nvar _flvParse2 = _interopRequireDefault(_flvParse);\n\nvar _tagdemux = __webpack_require__(1);\n\nvar _tagdemux2 = _interopRequireDefault(_tagdemux);\n\nvar _mp4remux = __webpack_require__(2);\n\nvar _mp4remux2 = _interopRequireDefault(_mp4remux);\n\nvar _mp4moof = __webpack_require__(13);\n\nvar _mp4moof2 = _interopRequireDefault(_mp4moof);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar flv2fmp4 = function () {\n\n /**\n * Creates an instance of flv2fmp4.\n * config 里面有_isLive属性,是否是直播\n * @param {any} config\n *\n * @memberof flv2fmp4\n */\n function flv2fmp4(config) {\n _classCallCheck(this, flv2fmp4);\n\n this._config = { _isLive: false };\n this._config = Object.assign(this._config, config);\n\n // 外部方法赋值\n this.onInitSegment = null;\n this.onMediaSegment = null;\n this.onMediaInfo = null;\n this.seekCallBack = null;\n\n // 内部使用\n this.loadmetadata = false;\n this.ftyp_moov = null;\n this.metaSuccRun = false;\n this.metas = [];\n this.parseChunk = null;\n this.hasVideo = false;\n this.hasAudio = false;\n // 临时记录seek时间\n this._pendingResolveSeekPoint = -1;\n\n // 临时记录flv数据起始时间\n this._tempBaseTime = 0;\n\n // 处理flv数据入口\n this.setflvBase = this.setflvBasefrist;\n\n _tagdemux2.default._onTrackMetadata = this.Metadata.bind(this);\n _tagdemux2.default._onMediaInfo = this.metaSucc.bind(this);\n _tagdemux2.default._onDataAvailable = this.onDataAvailable.bind(this);\n this.m4mof = new _mp4moof2.default(this._config);\n this.m4mof.onMediaSegment = this.onMdiaSegment.bind(this);\n }\n\n _createClass(flv2fmp4, [{\n key: 'seek',\n value: function seek(baseTime) {\n this.setflvBase = this.setflvBasefrist;\n if (baseTime == undefined || baseTime == 0) {\n baseTime = 0;\n this._pendingResolveSeekPoint = -1;\n }\n if (this._tempBaseTime != baseTime) {\n this._tempBaseTime = baseTime;\n _tagdemux2.default._timestampBase = baseTime;\n this.m4mof.seek(baseTime);\n this.m4mof.insertDiscontinuity();\n this._pendingResolveSeekPoint = baseTime;\n }\n }\n\n /**\n * 不要主动调用这个接口!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * 第一次接受数据,和seek时候接受数据入口,\n *\n * @param {any} arraybuff\n * @param {any} baseTime\n * @returns\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'setflvBasefrist',\n value: function setflvBasefrist(arraybuff, baseTime) {\n\n var offset = _flvParse2.default.setFlv(new Uint8Array(arraybuff));\n\n if (_flvParse2.default.arrTag.length > 0) {\n this.hasAudio = _flvParse2.default._hasAudio;\n this.hasVideo = _flvParse2.default._hasVideo;\n if (this._tempBaseTime != 0 && this._tempBaseTime == _flvParse2.default.arrTag[0].getTime()) {\n _tagdemux2.default._timestampBase = 0;\n }\n _tagdemux2.default.moofTag(_flvParse2.default.arrTag);\n this.setflvBase = this.setflvBaseUsually;\n }\n\n return offset;\n }\n\n /**\n * 不要主动调用这个接口!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * 后续接受数据接口\n * @param {any} arraybuff\n * @param {any} baseTime\n * @returns\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'setflvBaseUsually',\n value: function setflvBaseUsually(arraybuff, baseTime) {\n var offset = _flvParse2.default.setFlv(new Uint8Array(arraybuff));\n\n if (_flvParse2.default.arrTag.length > 0) {\n _tagdemux2.default.moofTag(_flvParse2.default.arrTag);\n }\n\n return offset;\n }\n\n /**\n * 不要主动调用这个接口!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * moof回调\n *\n * @param {any} track\n * @param {any} value\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'onMdiaSegment',\n value: function onMdiaSegment(track, value) {\n\n if (this.onMediaSegment) {\n this.onMediaSegment(new Uint8Array(value.data));\n }\n if (this._pendingResolveSeekPoint != -1 && track == 'video') {\n var seekpoint = this._pendingResolveSeekPoint;\n this._pendingResolveSeekPoint = -1;\n if (this.seekCallBack) {\n this.seekCallBack(seekpoint);\n }\n }\n }\n\n /**\n *\n * 音频和视频的初始化tag\n *\n * @param {any} type\n * @param {any} meta\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'Metadata',\n value: function Metadata(type, meta) {\n switch (type) {\n case 'video':\n this.metas.push(meta);\n this.m4mof._videoMeta = meta;\n if (this.hasVideo && !this.hasAudio) {\n this.metaSucc();\n return;\n }\n break;\n case 'audio':\n this.metas.push(meta);\n this.m4mof._audioMeta = meta;\n if (!this.hasVideo && this.hasAudio) {\n this.metaSucc();\n return;\n }\n break;\n }\n if (this.hasVideo && this.hasAudio && this.metaSuccRun && this.metas.length > 1) {\n this.metaSucc();\n }\n }\n\n /**\n * metadata解读成功后触发及第一个视频tag和第一个音频tag\n *\n * @param {any} mi\n * @returns\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'metaSucc',\n value: function metaSucc(mi) {\n if (this.onMediaInfo) {\n this.onMediaInfo(mi, { hasAudio: this.hasAudio, hasVideo: this.hasVideo });\n }\n // 获取ftyp和moov\n if (this.metas.length == 0) {\n this.metaSuccRun = true;\n return;\n }\n\n this.ftyp_moov = _mp4remux2.default.generateInitSegment(this.metas);\n if (this.onInitSegment && this.loadmetadata == false) {\n\n this.onInitSegment(this.ftyp_moov);\n this.loadmetadata = true;\n }\n }\n }, {\n key: 'onDataAvailable',\n value: function onDataAvailable(audiotrack, videotrack) {\n this.m4mof.remux(audiotrack, videotrack);\n }\n\n /**\n * 传入flv的二进制数据\n * 统一入口\n * @param {any} arraybuff\n * @param {any} baseTime flv数据开始时间\n * @returns\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'setflv',\n value: function setflv(arraybuff, baseTime) {\n return this.setflvBase(arraybuff, baseTime);\n }\n\n /**\n *\n * 本地调试代码,不用理会\n * @param {any} arraybuff\n * @returns\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'setflvloc',\n value: function setflvloc(arraybuff) {\n var offset = _flvParse2.default.setFlv(new Uint8Array(arraybuff));\n\n if (_flvParse2.default.arrTag.length > 0) {\n return _flvParse2.default.arrTag;\n }\n }\n }]);\n\n return flv2fmp4;\n}();\n\n/**\n * 封装的对外类,有些方法不想对外暴露,所以封装这么一个类\n *\n * @class foreign\n */\n\n\nvar foreign = function () {\n function foreign(config) {\n _classCallCheck(this, foreign);\n\n this.f2m = new flv2fmp4(config);\n // 外部方法赋值\n this._onInitSegment = null;\n this._onMediaSegment = null;\n this._onMediaInfo = null;\n this._seekCallBack = null;\n }\n\n /**\n *\n * 跳转\n * @param {any} basetime 跳转时间\n *\n * @memberof foreign\n */\n\n\n _createClass(foreign, [{\n key: 'seek',\n value: function seek(basetime) {\n this.f2m.seek(basetime);\n }\n\n /**\n * 传入flv的二进制数据\n * 统一入口\n * @param {any} arraybuff\n * @returns\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'setflv',\n value: function setflv(arraybuff) {\n return this.f2m.setflv(arraybuff, 0);\n }\n\n /**\n *\n * 本地调试代码,不用理会\n * @param {any} arraybuff\n * @returns\n *\n * @memberof flv2fmp4\n */\n\n }, {\n key: 'setflvloc',\n value: function setflvloc(arraybuff) {\n return this.f2m.setflvloc(arraybuff);\n }\n\n /**\n * 赋值初始化seg接受方法\n *\n *\n * @memberof foreign\n */\n\n }, {\n key: 'onInitSegment',\n set: function set(fun) {\n this._onInitSegment = fun;\n this.f2m.onInitSegment = fun;\n }\n\n /**\n * 赋值moof接受方法\n *\n *\n * @memberof foreign\n */\n\n }, {\n key: 'onMediaSegment',\n set: function set(fun) {\n this._onMediaSegment = fun;\n this.f2m.onMediaSegment = fun;\n }\n\n /**\n * 赋值metadata接受方法\n *\n *\n * @memberof foreign\n */\n\n }, {\n key: 'onMediaInfo',\n set: function set(fun) {\n this._onMediaInfo = fun;\n this.f2m.onMediaInfo = fun;\n }\n\n /**\n * 赋值是否跳转回调接受方法\n *\n *\n * @memberof foreign\n */\n\n }, {\n key: 'seekCallBack',\n set: function set(fun) {\n this._seekCallBack = fun;\n this.f2m.seekCallBack = fun;\n }\n }]);\n\n return foreign;\n}();\n\nexports.default = foreign;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9mbHYyZm1wNC5qcz84ZTQ3Il0sIm5hbWVzIjpbImZsdjJmbXA0IiwiY29uZmlnIiwiX2NvbmZpZyIsIl9pc0xpdmUiLCJPYmplY3QiLCJhc3NpZ24iLCJvbkluaXRTZWdtZW50Iiwib25NZWRpYVNlZ21lbnQiLCJvbk1lZGlhSW5mbyIsInNlZWtDYWxsQmFjayIsImxvYWRtZXRhZGF0YSIsImZ0eXBfbW9vdiIsIm1ldGFTdWNjUnVuIiwibWV0YXMiLCJwYXJzZUNodW5rIiwiaGFzVmlkZW8iLCJoYXNBdWRpbyIsIl9wZW5kaW5nUmVzb2x2ZVNlZWtQb2ludCIsIl90ZW1wQmFzZVRpbWUiLCJzZXRmbHZCYXNlIiwic2V0Zmx2QmFzZWZyaXN0IiwiX29uVHJhY2tNZXRhZGF0YSIsIk1ldGFkYXRhIiwiYmluZCIsIl9vbk1lZGlhSW5mbyIsIm1ldGFTdWNjIiwiX29uRGF0YUF2YWlsYWJsZSIsIm9uRGF0YUF2YWlsYWJsZSIsIm00bW9mIiwib25NZGlhU2VnbWVudCIsImJhc2VUaW1lIiwidW5kZWZpbmVkIiwiX3RpbWVzdGFtcEJhc2UiLCJzZWVrIiwiaW5zZXJ0RGlzY29udGludWl0eSIsImFycmF5YnVmZiIsIm9mZnNldCIsInNldEZsdiIsIlVpbnQ4QXJyYXkiLCJhcnJUYWciLCJsZW5ndGgiLCJfaGFzQXVkaW8iLCJfaGFzVmlkZW8iLCJnZXRUaW1lIiwibW9vZlRhZyIsInNldGZsdkJhc2VVc3VhbGx5IiwidHJhY2siLCJ2YWx1ZSI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50ID0gdGhpcy5fcGVuZGluZ1Jlc29sdmVTZWVrUG9pbnQ7XG4gICAgICAgICAgICB0aGlzLl9wZW5kaW5nUmVzb2x2ZVNlZWtQb2ludCA9IC0xO1xuICAgICAgICAgICAgaWYgKHRoaXMuc2Vla0NhbGxCYWNrKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZWVrQ2FsbEJhY2soc2Vla3BvaW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqXG4gICAgICog6Z+z6aKR5ZKM6KeG6aKR55qE5Yid5aeL5YyWdGFnXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge2FueX0gdHlwZVxuICAgICAqIEBwYXJhbSB7YW55fSBtZXRhXG4gICAgICpcbiAgICAgKiBAbWVtYmVyb2YgZmx2MmZtcDRcbiAgICAgKi9cbiAgICBNZXRhZGF0YSh0eXBlLCBtZXRhKSB7XG4gICAgICAgIHN3aXRjaCAodHlwZSkge1xuICAgICAgICAgICAgY2FzZSAndmlkZW8nOlxuICAgICAgICAgICAgICAgIHRoaXMubWV0YXMucHVzaChtZXRhKTtcbiAgICAgICAgICAgICAgICB0aGlzLm00bW9mLl92aWRlb01ldGEgPSBtZXRhO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmhhc1ZpZGVvICYmICF0aGlzLmhhc0F1ZGlvKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWV0YVN1Y2MoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2F1ZGlvJzpcbiAgICAgICAgICAgICAgICB0aGlzLm1ldGFzLnB1c2gobWV0YSk7XG4gICAgICAgICAgICAgICAgdGhpcy5tNG1vZi5fYXVkaW9NZXRhID0gbWV0YTtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuaGFzVmlkZW8gJiYgdGhpcy5oYXNBdWRpbykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm1ldGFTdWNjKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuaGFzVmlkZW8gJiYgdGhpcy5oYXNBdWRpbyAmJiB0aGlzLm1ldGFTdWNjUnVuICYmIHRoaXMubWV0YXMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgdGhpcy5tZXRhU3VjYygpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogbWV0YWRhdGHop6Por7vmiJDlip/lkI7op6blj5Hlj4rnrKzkuIDkuKrop4bpopF0YWflkoznrKzkuIDkuKrpn7PpopF0YWdcbiAgICAgKlxuICAgICAqIEBwYXJhbSB7YW55fSBtaVxuICAgICAqIEByZXR1cm5zXG4gICAgICpcbiAgICAgKiBAbWVtYmVyb2YgZmx2MmZtcDRcbiAgICAgKi9cbiAgICBtZXRhU3VjYyhtaSkge1xuICAgICAgICBpZiAodGhpcy5vbk1lZGlhSW5mbykge1xuICAgICAgICAgICAgdGhpcy5vbk1lZGlhSW5mbyhtaSwgeyBoYXNBdWRpbzogdGhpcy5oYXNBdWRpbywgaGFzVmlkZW86IHRoaXMuaGFzVmlkZW8gfSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8g6I635Y+WZnR5cOWSjG1vb3ZcbiAgICAgICAgaWYgKHRoaXMubWV0YXMubGVuZ3RoID09IDApIHtcbiAgICAgICAgICAgIHRoaXMubWV0YVN1Y2NSdW4gPSB0cnVlO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5mdHlwX21vb3YgPSBtcDRyZW11eC5nZW5lcmF0ZUluaXRTZWdtZW50KHRoaXMubWV0YXMpO1xuICAgICAgICBpZiAodGhpcy5vbkluaXRTZWdtZW50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+IDApIHtcbiAgICAgICAgICAgIHJldHVybiBmbHZwYXJzZS5hcnJUYWc7XG4gICAgICAgIH1cbiAgICB9XG59XG5cbi8qKlxuICog5bCB6KOF55qE5a+55aSW57G7LOacieS6m+aWueazleS4jeaDs+WvueWkluaatOmcsizmiYDku6XlsIHoo4Xov5nkuYjkuIDkuKrnsbtcbiAqXG4gKiBAY2xhc3MgZm9yZWlnblxuICovXG5jbGFzcyBmb3JlaWduIHtcbiAgICBjb25zdHJ1Y3Rvcihjb25maWcpIHtcblxuICAgICAgICB0aGlzLmYybSA9IG5ldyBmbHYyZm1wNChjb25maWcpO1xuICAgICAgICAvLyDlpJbpg6jmlrnms5XotYvlgLxcbiAgICAgICAgdGhpcy5fb25Jbml0U2VnbWVudCA9IG51bGw7XG4gICAgICAgIHRoaXMuX29uTWVkaWFTZWdtZW50ID0gbnVsbDtcbiAgICAgICAgdGhpcy5fb25NZWRpYUluZm8gPSBudWxsO1xuICAgICAgICB0aGlzLl9zZWVrQ2FsbEJhY2sgPSBudWxsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqXG4gICAgICog6Lez6L2sXG4gICAgICogQHBhcmFtIHthbnl9IGJhc2V0aW1lICDot7Povazml7bpl7RcbiAgICAgKlxuICAgICAqIEBtZW1iZXJvZiBmb3JlaWduXG4gICAgICovXG4gICAgc2VlayhiYXNldGltZSkge1xuICAgICAgICB0aGlzLmYybS5zZWVrKGJhc2V0aW1lKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiDkvKDlhaVmbHbnmoTkuozov5vliLbmlbDmja5cbiAgICAgKiDnu5/kuIDlhaXlj6NcbiAgICAgKiBAcGFyYW0ge2FueX0gYXJyYXlidWZmXG4gICAgICogQHJldHVybnNcbiAgICAgKlxuICAgICAqIEBtZW1iZXJvZiBmbHYyZm1wNFxuICAgICAqL1xuICAgIHNldGZsdihhcnJheWJ1ZmYpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZjJtLnNldGZsdihhcnJheW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Ghpcy5mMm0ub25NZWRpYUluZm8gPSBmdW47XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICog6LWL5YC85piv5ZCm6Lez6L2s5Zue6LCD5o6l5Y+X5pa55rOVXG4gICAgICpcbiAgICAgKlxuICAgICAqIEBtZW1iZXJvZiBmb3JlaWduXG4gICAgICovXG4gICAgc2V0IHNlZWtDYWxsQmFjayhmdW4pIHtcbiAgICAgICAgdGhpcy5fc2Vla0NhbGxCYWNrID0gZnVuO1xuICAgICAgICB0aGlzLmYybS5zZWVrQ2FsbEJhY2sgPSBmdW47XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBmb3JlaWduO1xuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2pzL2ZsdjJmbXA0LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * Copyright (C) 2016 Bilibili. All Rights Reserved.\n *\n * This file is modified from dailymotion's hls.js library (hls.js/src/helper/aac.js)\n * @author zheng qian <[email protected]>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable */\nvar AAC = function () {\n function AAC() {\n _classCallCheck(this, AAC);\n }\n\n _createClass(AAC, null, [{\n key: \"getSilentFrame\",\n value: function getSilentFrame(channelCount) {\n if (channelCount === 1) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n } else if (channelCount === 2) {\n return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n } else if (channelCount === 3) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n } else if (channelCount === 4) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n } else if (channelCount === 5) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n } else if (channelCount === 6) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9tcDQvYWFjLXNpbGVudC5qcz84YWU3Il0sIm5hbWVzIjpbIkFBQyIsImNoYW5uZWxDb3VudCIsIlVpbnQ4QXJyYXkiXSwibWFwcG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LCAweGM4LCAweDAwLCAweDgwLCAweDIwLCAweDg0LCAweDAxLCAweDI2LCAweDQwLCAweDA4LCAweDY0LCAweDAwLCAweDgyLCAweDMwLCAweDA0LCAweDk5LCAweDAwLCAweDIxLCAweDkwLCAweDAyLCAweDM4XSk7XG4gICAgICAgIH0gZWxzZSBpZiAoY2hhbm5lbENvdW50ID09PSA2KSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFVpbnQ4QXJyYXkoWzB4MDAsIDB4YzgsIDB4MDAsIDB4ODAsIDB4MjAsIDB4ODQsIDB4MDEsIDB4MjYsIDB4NDAsIDB4MDgsIDB4NjQsIDB4MDAsIDB4ODIsIDB4MzAsIDB4MDQsIDB4OTksIDB4MDAsIDB4MjEsIDB4OTAsIDB4MDIsIDB4MDAsIDB4YjIsIDB4MDAsIDB4MjAsIDB4MDgsIDB4ZTBdKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgQUFDO1xuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2pzL21wNC9hYWMtc2lsZW50LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * Copyright (C) 2016 Bilibili. All Rights Reserved.\n *\n * @author zheng qian <[email protected]>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable */\n// Represents an media sample (audio / video)\nvar SampleInfo = exports.SampleInfo = function SampleInfo(dts, pts, duration, originalDts, isSync) {\n _classCallCheck(this, SampleInfo);\n\n this.dts = dts;\n this.pts = pts;\n this.duration = duration;\n this.originalDts = originalDts;\n this.isSyncPoint = isSync;\n this.fileposition = null;\n};\n\n// Media Segment concept is defined in Media Source Extensions spec.\n// Particularly in ISO BMFF format, an Media Segment contains a moof box followed by a mdat box.\n\n\nvar MediaSegmentInfo = exports.MediaSegmentInfo = function () {\n function MediaSegmentInfo() {\n _classCallCheck(this, MediaSegmentInfo);\n\n this.beginDts = 0;\n this.endDts = 0;\n this.beginPts = 0;\n this.endPts = 0;\n this.originalBeginDts = 0;\n this.originalEndDts = 0;\n this.syncPoints = []; // SampleInfo[n], for video IDR frames only\n this.firstSample = null; // SampleInfo\n this.lastSample = null; // SampleInfo\n }\n\n _createClass(MediaSegmentInfo, [{\n key: \"appendSyncPoint\",\n value: function appendSyncPoint(sampleInfo) {\n // also called Random Access Point\n sampleInfo.isSyncPoint = true;\n this.syncPoints.push(sampleInfo);\n }\n }]);\n\n return MediaSegmentInfo;\n}();\n\n// Ordered list for recording video IDR frames, sorted by originalDts\n\n\nvar IDRSampleList = exports.IDRSampleList = function () {\n function IDRSampleList() {\n _classCallCheck(this, IDRSampleList);\n\n this._list = [];\n }\n\n _createClass(IDRSampleList, [{\n key: \"clear\",\n value: function clear() {\n this._list = [];\n }\n }, {\n key: \"appendArray\",\n value: function appendArray(syncPoints) {\n var list = this._list;\n\n if (syncPoints.length === 0) {\n return;\n }\n\n if (list.length > 0 && syncPoints[0].originalDts < list[list.length - 1].originalDts) {\n this.clear();\n }\n\n Array.prototype.push.apply(list, syncPoints);\n }\n }, {\n key: \"getLastSyncPointBeforeDts\",\n value: function getLastSyncPointBeforeDts(dts) {\n if (this._list.length == 0) {\n return null;\n }\n\n var list = this._list;\n var idx = 0;\n var last = list.length - 1;\n var mid = 0;\n var lbound = 0;\n var ubound = last;\n\n if (dts < list[0].dts) {\n idx = 0;\n lbound = ubound + 1;\n }\n\n while (lbound <= ubound) {\n mid = lbound + Math.floor((ubound - lbound) / 2);\n if (mid === last || dts >= list[mid].dts && dts < list[mid + 1].dts) {\n idx = mid;\n break;\n } else if (list[mid].dts < dts) {\n lbound = mid + 1;\n } else {\n ubound = mid - 1;\n }\n }\n return this._list[idx];\n }\n }]);\n\n return IDRSampleList;\n}();\n\n// Data structure for recording information of media segments in single track.\n\n\nvar MediaSegmentInfoList = exports.MediaSegmentInfoList = function () {\n function MediaSegmentInfoList(type) {\n _classCallCheck(this, MediaSegmentInfoList);\n\n this._type = type;\n this._list = [];\n this._lastAppendLocation = -1; // cached last insert location\n }\n\n _createClass(MediaSegmentInfoList, [{\n key: \"isEmpty\",\n value: function isEmpty() {\n return this._list.length === 0;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this._list = [];\n this._lastAppendLocation = -1;\n }\n }, {\n key: \"_searchNearestSegmentBefore\",\n value: function _searchNearestSegmentBefore(originalBeginDts) {\n var list = this._list;\n if (list.length === 0) {\n return -2;\n }\n var last = list.length - 1;\n var mid = 0;\n var lbound = 0;\n var ubound = last;\n\n var idx = 0;\n\n if (originalBeginDts < list[0].originalBeginDts) {\n idx = -1;\n return idx;\n }\n\n while (lbound <= ubound) {\n mid = lbound + Math.floor((ubound - lbound) / 2);\n if (mid === last || originalBeginDts > list[mid].lastSample.originalDts && originalBeginDts < list[mid + 1].originalBeginDts) {\n idx = mid;\n break;\n } else if (list[mid].originalBeginDts < originalBeginDts) {\n lbound = mid + 1;\n } else {\n ubound = mid - 1;\n }\n }\n return idx;\n }\n }, {\n key: \"_searchNearestSegmentAfter\",\n value: function _searchNearestSegmentAfter(originalBeginDts) {\n return this._searchNearestSegmentBefore(originalBeginDts) + 1;\n }\n }, {\n key: \"append\",\n value: function append(mediaSegmentInfo) {\n var list = this._list;\n var msi = mediaSegmentInfo;\n var lastAppendIdx = this._lastAppendLocation;\n var insertIdx = 0;\n\n if (lastAppendIdx !== -1 && lastAppendIdx < list.length && msi.originalBeginDts >= list[lastAppendIdx].lastSample.originalDts && (lastAppendIdx === list.length - 1 || lastAppendIdx < list.length - 1 && msi.originalBeginDts < list[lastAppendIdx + 1].originalBeginDts)) {\n insertIdx = lastAppendIdx + 1; // use cached location idx\n } else {\n if (list.length > 0) {\n insertIdx = this._searchNearestSegmentBefore(msi.originalBeginDts) + 1;\n }\n }\n\n this._lastAppendLocation = insertIdx;\n this._list.splice(insertIdx, 0, msi);\n }\n }, {\n key: \"getLastSegmentBefore\",\n value: function getLastSegmentBefore(originalBeginDts) {\n var idx = this._searchNearestSegmentBefore(originalBeginDts);\n if (idx >= 0) {\n return this._list[idx];\n } else {\n // -1\n return null;\n }\n }\n }, {\n key: \"getLastSampleBefore\",\n value: function getLastSampleBefore(originalBeginDts) {\n var segment = this.getLastSegmentBefore(originalBeginDts);\n if (segment != null) {\n return segment.lastSample;\n } else {\n return null;\n }\n }\n }, {\n key: \"getLastSyncPointBefore\",\n value: function getLastSyncPointBefore(originalBeginDts) {\n var segmentIdx = this._searchNearestSegmentBefore(originalBeginDts);\n var syncPoints = this._list[segmentIdx].syncPoints;\n while (syncPoints.length === 0 && segmentIdx > 0) {\n segmentIdx--;\n syncPoints = this._list[segmentIdx].syncPoints;\n }\n if (syncPoints.length > 0) {\n return syncPoints[syncPoints.length - 1];\n } else {\n return null;\n }\n }\n }, {\n key: \"type\",\n get: function get() {\n return this._type;\n }\n }, {\n key: \"length\",\n get: function get() {\n return this._list.length;\n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gICAgICBsZXQgdWJvdW5kID0gbGFzdDtcblxuICAgICAgICBpZiAoZHRzIDwgbGlzdFswXS5kdHMpIHtcbiAgICAgICAgICAgIGlkeCA9IDA7XG4gICAgICAgICAgICBsYm91bmQgPSB1Ym91bmQgKyAxO1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKGxib3VuZCA8PSB1Ym91bmQpIHtcbiAgICAgICAgICAgIG1pZCA9IGxib3VuZCArIE1hdGguZmxvb3IoKHVib3VuZCAtIGxib3VuZCkgLyAyKTtcbiAgICAgICAgICAgIGlmIChtaWQgPT09IGxhc3QgfHwgKGR0cyA+PSBsaXN0W21pZF0uZHRzICYmIGR0cyA8IGxpc3RbbWlkICsgMV0uZHRzKSkge1xuICAgICAgICAgICAgICAgIGlkeCA9IG1pZDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGlzdFttaWRdLmR0cyA8IGR0cykge1xuICAgICAgICAgICAgICAgIGxib3VuZCA9IG1pZCArIDE7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHVib3VuZCA9IG1pZCAtIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuX2xpc3RbaWR4XTtcbiAgICB9XG5cbn1cblxuLy8gRGF0YSBzdHJ1Y3R1cmUgZm9yIHJlY29yZGluZyBpbmZvcm1hdGlvbiBvZiBtZWRpYSBzZWdtZW50cyBpbiBzaW5nbGUgdHJhY2suXG5leHBvcnQgY2xhc3MgTWVkaWFTZWdtZW50SW5mb0xpc3Qge1xuXG4gICAgY29uc3RydWN0b3IodHlwZSkge1xuICAgICAgICB0aGlzLl90eXBlID0gdHlwZTtcbiAgICAgICAgdGhpcy5fbGlzdCA9IFtdO1xuICAgICAgICB0aGlzLl9sYXN0QXBwZW5kTG9jYXRpb24gPSAtMTsgLy8gY2FjaGVkIGxhc3QgaW5zZXJ0IGxvY2F0aW9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IifQ==");
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * Copyright (C) 2016 Bilibili. All Rights Reserved.\n *\n * @author zheng qian <[email protected]>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable */\n\n\nvar _aacSilent = __webpack_require__(11);\n\nvar _aacSilent2 = _interopRequireDefault(_aacSilent);\n\nvar _browser = __webpack_require__(14);\n\nvar _browser2 = _interopRequireDefault(_browser);\n\nvar _mp4remux = __webpack_require__(2);\n\nvar _mp4remux2 = _interopRequireDefault(_mp4remux);\n\nvar _mediaSegmentInfo = __webpack_require__(12);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Fragmented mp4 remuxer\nvar MP4Remuxer = function () {\n function MP4Remuxer(config) {\n _classCallCheck(this, MP4Remuxer);\n\n this.TAG = this.constructor.name;\n\n this._config = config;\n this._isLive = config.isLive === true;\n\n this._dtsBase = -1;\n this._dtsBaseInited = false;\n this._audioDtsBase = Infinity;\n this._videoDtsBase = Infinity;\n this._audioNextDts = undefined;\n this._videoNextDts = undefined;\n\n this._audioMeta = null;\n this._videoMeta = null;\n\n this._audioSegmentInfoList = new _mediaSegmentInfo.MediaSegmentInfoList('audio');\n this._videoSegmentInfoList = new _mediaSegmentInfo.MediaSegmentInfoList('video');\n\n this._onInitSegment = null;\n this._onMediaSegment = null;\n\n // Workaround for chrome < 50: Always force first sample as a Random Access Point in media segment\n // see https://bugs.chromium.org/p/chromium/issues/detail?id=229412\n this._forceFirstIDR = !!(_browser2.default.chrome && (_browser2.default.version.major < 50 || _browser2.default.version.major === 50 && _browser2.default.version.build < 2661));\n\n // Workaround for IE11/Edge: Fill silent aac frame after keyframe-seeking\n // Make audio beginDts equals with video beginDts, in order to fix seek freeze\n this._fillSilentAfterSeek = _browser2.default.msedge || _browser2.default.msie;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {\n this._dtsBase = -1;\n this._dtsBaseInited = false;\n this._audioMeta = null;\n this._videoMeta = null;\n this._audioSegmentInfoList.clear();\n this._audioSegmentInfoList = null;\n this._videoSegmentInfoList.clear();\n this._videoSegmentInfoList = null;\n this._onInitSegment = null;\n this._onMediaSegment = null;\n }\n }, {\n key: 'bindDataSource',\n value: function bindDataSource(producer) {\n producer.onDataAvailable = this.remux.bind(this);\n producer.onTrackMetadata = this._onTrackMetadataReceived.bind(this);\n return this;\n }\n\n /* prototype: function onInitSegment(type: string, initSegment: ArrayBuffer): void\n InitSegment: {\n type: string,\n data: ArrayBuffer,\n codec: string,\n container: string\n }\n */\n\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._audioNextDts = this._videoNextDts = undefined;\n }\n }, {\n key: 'seek',\n value: function seek(originalDts) {\n this._videoSegmentInfoList.clear();\n this._audioSegmentInfoList.clear();\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack) {\n if (!this._onMediaSegment) {\n throw new IllegalStateException('MP4Remuxer: onMediaSegment callback must be specificed!');\n }\n if (!this._dtsBaseInited) {\n this._calculateDtsBase(audioTrack, videoTrack);\n }\n this._remuxVideo(videoTrack);\n this._remuxAudio(audioTrack);\n }\n }, {\n key: '_onTrackMetadataReceived',\n value: function _onTrackMetadataReceived(type, metadata) {\n var metabox = null;\n\n if (type === 'audio') {\n this._audioMeta = metadata;\n metabox = _mp4remux2.default.generateInitSegment(metadata);\n Log.v('msg+audio', metadata);\n } else if (type === 'video') {\n this._videoMeta = metadata;\n metabox = _mp4remux2.default.generateInitSegment(metadata);\n Log.v('msg+video', metadata);\n } else {\n return;\n }\n\n // dispatch metabox (Initialization Segment)\n if (!this._onInitSegment) {\n throw new IllegalStateException('MP4Remuxer: onInitSegment callback must be specified!');\n }\n this._onInitSegment(type, {\n type: type,\n data: metabox.buffer,\n codec: metadata.codec,\n container: type + '/mp4'\n });\n }\n }, {\n key: '_calculateDtsBase',\n value: function _calculateDtsBase(audioTrack, videoTrack) {\n if (this._dtsBaseInited) {\n return;\n }\n\n if (audioTrack.samples && audioTrack.samples.length) {\n this._audioDtsBase = audioTrack.samples[0].dts;\n }\n if (videoTrack.samples && videoTrack.samples.length) {\n this._videoDtsBase = videoTrack.samples[0].dts;\n }\n\n this._dtsBase = Math.min(this._audioDtsBase, this._videoDtsBase);\n this._dtsBaseInited = true;\n }\n }, {\n key: '_remuxAudio',\n value: function _remuxAudio(audioTrack) {\n var track = audioTrack;\n var samples = track.samples;\n var dtsCorrection = void 0;\n var firstDts = -1,\n lastDts = -1,\n lastPts = -1;\n\n var remuxSilentFrame = false;\n var silentFrameDuration = -1;\n\n if (!samples || samples.length === 0) {\n return;\n }\n\n var bytes = 8 + track.length;\n var mdatbox = new Uint8Array(bytes);\n mdatbox[0] = bytes >>> 24 & 0xFF;\n mdatbox[1] = bytes >>> 16 & 0xFF;\n mdatbox[2] = bytes >>> 8 & 0xFF;\n mdatbox[3] = bytes & 0xFF;\n\n mdatbox.set(_mp4remux2.default.types.mdat, 4);\n\n var offset = 8; // size + type\n var mp4Samples = [];\n\n while (samples.length) {\n var aacSample = samples.shift();\n var unit = aacSample.unit;\n var originalDts = aacSample.dts - this._dtsBase;\n\n if (dtsCorrection == undefined) {\n if (this._audioNextDts == undefined) {\n if (this._audioSegmentInfoList.isEmpty()) {\n dtsCorrection = 0;\n if (this._fillSilentAfterSeek && !this._videoSegmentInfoList.isEmpty()) {\n remuxSilentFrame = true;\n }\n } else {\n var lastSample = this._audioSegmentInfoList.getLastSampleBefore(originalDts);\n if (lastSample != null) {\n var distance = originalDts - (lastSample.originalDts + lastSample.duration);\n if (distance <= 3) {\n distance = 0;\n }\n var expectedDts = lastSample.dts + lastSample.duration + distance;\n dtsCorrection = originalDts - expectedDts;\n } else {\n // lastSample == null\n dtsCorrection = 0;\n }\n }\n } else {\n dtsCorrection = originalDts - this._audioNextDts;\n }\n }\n\n var dts = originalDts - dtsCorrection;\n if (remuxSilentFrame) {\n // align audio segment beginDts to match with current video segment's beginDts\n var videoSegment = this._videoSegmentInfoList.getLastSegmentBefore(originalDts);\n if (videoSegment != null && videoSegment.beginDts < dts) {\n silentFrameDuration = dts - videoSegment.beginDts;\n dts = videoSegment.beginDts;\n } else {\n remuxSilentFrame = false;\n }\n }\n if (firstDts === -1) {\n firstDts = dts;\n }\n\n if (remuxSilentFrame) {\n remuxSilentFrame = false;\n samples.unshift(aacSample);\n\n var frame = this._generateSilentAudio(dts, silentFrameDuration);\n if (frame == null) {\n continue;\n }\n var _mp4Sample = frame.mp4Sample;\n var _unit = frame.unit;\n\n mp4Samples.push(_mp4Sample);\n\n // re-allocate mdatbox buffer with new size, to fit with this silent frame\n bytes += _unit.byteLength;\n mdatbox = new Uint8Array(bytes);\n mdatbox[0] = bytes >>> 24 & 0xFF;\n mdatbox[1] = bytes >>> 16 & 0xFF;\n mdatbox[2] = bytes >>> 8 & 0xFF;\n mdatbox[3] = bytes & 0xFF;\n mdatbox.set(_mp4remux2.default.types.mdat, 4);\n\n // fill data now\n mdatbox.set(_unit, offset);\n offset += _unit.byteLength;\n continue;\n }\n\n var sampleDuration = 0;\n\n if (samples.length >= 1) {\n var nextDts = samples[0].dts - this._dtsBase - dtsCorrection;\n sampleDuration = nextDts - dts;\n } else {\n if (mp4Samples.length >= 1) {\n // use second last sample duration\n sampleDuration = mp4Samples[mp4Samples.length - 1].duration;\n } else {\n // the only one sample, use reference sample duration\n sampleDuration = this._audioMeta.refSampleDuration;\n }\n }\n\n var mp4Sample = {\n dts: dts,\n pts: dts,\n cts: 0,\n size: unit.byteLength,\n duration: sampleDuration,\n originalDts: originalDts,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0\n }\n };\n mp4Samples.push(mp4Sample);\n mdatbox.set(unit, offset);\n offset += unit.byteLength;\n }\n var latest = mp4Samples[mp4Samples.length - 1];\n lastDts = latest.dts + latest.duration;\n this._audioNextDts = lastDts;\n\n // fill media segment info & add to info list\n var info = new _mediaSegmentInfo.MediaSegmentInfo();\n info.beginDts = firstDts;\n info.endDts = lastDts;\n info.beginPts = firstDts;\n info.endPts = lastDts;\n info.originalBeginDts = mp4Samples[0].originalDts;\n info.originalEndDts = latest.originalDts + latest.duration;\n info.firstSample = new _mediaSegmentInfo.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, false);\n info.lastSample = new _mediaSegmentInfo.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, false);\n if (!this._isLive) {\n this._audioSegmentInfoList.append(info);\n }\n\n track.samples = mp4Samples;\n track.sequenceNumber += track.addcoefficient;\n\n var moofbox = _mp4remux2.default.moof(track, firstDts);\n track.samples = [];\n track.length = 0;\n\n this._onMediaSegment('audio', {\n type: 'audio',\n data: this._mergeBoxes(moofbox, mdatbox).buffer,\n sampleCount: mp4Samples.length,\n info: info\n });\n }\n }, {\n key: '_generateSilentAudio',\n value: function _generateSilentAudio(dts, frameDuration) {\n Log.v(this.TAG, 'GenerateSilentAudio: dts = ' + dts + ', duration = ' + frameDuration);\n\n var unit = _aacSilent2.default.getSilentFrame(this._audioMeta.channelCount);\n if (unit == null) {\n Log.w(this.TAG, 'Cannot generate silent aac frame for channelCount = ' + this._audioMeta.channelCount);\n return null;\n }\n\n var mp4Sample = {\n dts: dts,\n pts: dts,\n cts: 0,\n size: unit.byteLength,\n duration: frameDuration,\n originalDts: dts,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0\n }\n };\n\n return {\n unit: unit,\n mp4Sample: mp4Sample\n };\n }\n }, {\n key: '_remuxVideo',\n value: function _remuxVideo(videoTrack) {\n var track = videoTrack;\n var samples = track.samples;\n var dtsCorrection = void 0;\n var firstDts = -1,\n lastDts = -1;\n var firstPts = -1,\n lastPts = -1;\n\n if (!samples || samples.length === 0) {\n return;\n }\n\n var bytes = 8 + videoTrack.length;\n var mdatbox = new Uint8Array(bytes);\n mdatbox[0] = bytes >>> 24 & 0xFF;\n mdatbox[1] = bytes >>> 16 & 0xFF;\n mdatbox[2] = bytes >>> 8 & 0xFF;\n mdatbox[3] = bytes & 0xFF;\n mdatbox.set(_mp4remux2.default.types.mdat, 4);\n\n var offset = 8;\n var mp4Samples = [];\n var info = new _mediaSegmentInfo.MediaSegmentInfo();\n\n while (samples.length) {\n var avcSample = samples.shift();\n var keyframe = avcSample.isKeyframe;\n var originalDts = avcSample.dts - this._dtsBase;\n\n if (dtsCorrection == undefined) {\n if (this._videoNextDts == undefined) {\n if (this._videoSegmentInfoList.isEmpty()) {\n dtsCorrection = 0;\n } else {\n var lastSample = this._videoSegmentInfoList.getLastSampleBefore(originalDts);\n if (lastSample != null) {\n var distance = originalDts - (lastSample.originalDts + lastSample.duration);\n if (distance <= 3) {\n distance = 0;\n }\n var expectedDts = lastSample.dts + lastSample.duration + distance;\n dtsCorrection = originalDts - expectedDts;\n } else {\n // lastSample == null\n dtsCorrection = 0;\n }\n }\n } else {\n dtsCorrection = originalDts - this._videoNextDts;\n }\n }\n\n var dts = originalDts - dtsCorrection;\n var cts = avcSample.cts;\n var pts = dts + cts;\n\n if (firstDts === -1) {\n firstDts = dts;\n firstPts = pts;\n }\n\n // fill mdat box\n var sampleSize = 0;\n while (avcSample.units.length) {\n var unit = avcSample.units.shift();\n var data = unit.data;\n mdatbox.set(data, offset);\n offset += data.byteLength;\n sampleSize += data.byteLength;\n }\n\n var sampleDuration = 0;\n\n if (samples.length >= 1) {\n var nextDts = samples[0].dts - this._dtsBase - dtsCorrection;\n sampleDuration = nextDts - dts;\n } else {\n if (mp4Samples.length >= 1) {\n // lastest sample, use second last duration\n sampleDuration = mp4Samples[mp4Samples.length - 1].duration;\n } else {\n // the only one sample, use reference duration\n sampleDuration = this._videoMeta.refSampleDuration;\n }\n }\n\n if (keyframe) {\n var syncPoint = new _mediaSegmentInfo.SampleInfo(dts, pts, sampleDuration, avcSample.dts, true);\n syncPoint.fileposition = avcSample.fileposition;\n info.appendSyncPoint(syncPoint);\n }\n\n var mp4Sample = {\n dts: dts,\n pts: pts,\n cts: cts,\n size: sampleSize,\n isKeyframe: keyframe,\n duration: sampleDuration,\n originalDts: originalDts,\n flags: {\n isLeading: 0,\n dependsOn: keyframe ? 2 : 1,\n isDependedOn: keyframe ? 1 : 0,\n hasRedundancy: 0,\n isNonSync: keyframe ? 0 : 1\n }\n };\n\n mp4Samples.push(mp4Sample);\n }\n var latest = mp4Samples[mp4Samples.length - 1];\n lastDts = latest.dts + latest.duration;\n lastPts = latest.pts + latest.duration;\n this._videoNextDts = lastDts;\n\n // fill media segment info & add to info list\n info.beginDts = firstDts;\n info.endDts = lastDts;\n info.beginPts = firstPts;\n info.endPts = lastPts;\n info.originalBeginDts = mp4Samples[0].originalDts;\n info.originalEndDts = latest.originalDts + latest.duration;\n info.firstSample = new _mediaSegmentInfo.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, mp4Samples[0].isKeyframe);\n info.lastSample = new _mediaSegmentInfo.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, latest.isKeyframe);\n if (!this._isLive) {\n this._videoSegmentInfoList.append(info);\n }\n\n track.samples = mp4Samples;\n track.sequenceNumber += track.addcoefficient;\n\n // workaround for chrome < 50: force first sample as a random access point\n // see https://bugs.chromium.org/p/chromium/issues/detail?id=229412\n if (this._forceFirstIDR) {\n var flags = mp4Samples[0].flags;\n flags.dependsOn = 2;\n flags.isNonSync = 0;\n }\n\n var moofbox = _mp4remux2.default.moof(track, firstDts);\n track.samples = [];\n track.length = 0;\n\n this._onMediaSegment('video', {\n type: 'video',\n data: this._mergeBoxes(moofbox, mdatbox).buffer,\n sampleCount: mp4Samples.length,\n info: info\n });\n }\n }, {\n key: '_mergeBoxes',\n value: function _mergeBoxes(moof, mdat) {\n var result = new Uint8Array(moof.byteLength + mdat.byteLength);\n result.set(moof, 0);\n result.set(mdat, moof.byteLength);\n return result;\n }\n }, {\n key: 'onInitSegment',\n get: function get() {\n return this._onInitSegment;\n },\n set: function set(callback) {\n this._onInitSegment = callback;\n }\n\n /* prototype: function onMediaSegment(type: string, mediaSegment: MediaSegment): void\n MediaSegment: {\n type: string,\n data: ArrayBuffer,\n sampleCount: int32\n info: MediaSegmentInfo\n }\n */\n\n }, {\n key: 'onMediaSegment',\n get: function get() {\n return this._onMediaSegment;\n },\n set: function set(callback) {\n this._onMediaSegment = callback;\n }\n }]);\n\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy9tcDQvbXA0bW9vZi5qcz9mZGQ0Il0sIm5hbWVzIjpbIk1QNFJlbXV4ZXIiLCJjb25maWciLCJUQUciLCJjb25zdHJ1Y3RvciIsIm5hbWUiLCJfY29uZmlnIiwiX2lzTGl2ZSIsImlzTGl2ZSIsIl9kdHNCYXNlIiwiX2R0c0Jhc2VJbml0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pcyk7XG4gICAgICAgIHByb2R1Y2VyLm9uVHJhY2tNZXRhZGF0YSA9IHRoaXMuX29uVHJhY2tNZXRhZGF0YVJlY2VpdmVkLmJpbmQodGhpcyk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIC8qIHByb3RvdHlwZTogZnVuY3Rpb24gb25Jbml0U2VnbWVudCh0eXBlOiBzdHJpbmcsIGluaXRTZWdtZW50OiBBcnJheUJ1ZmZlcik6IHZvaWRcbiAgICAgICBJbml0U2VnbWVudDoge1xuICAgICAgICAgICB0eXBlOiBzdHJpbmcsXG4gICAgICAgICAgIGRhdGE6IEFycmF5QnVmZmVyLFxuICAgICAgICAgICBjb2RlYzogc3RyaW5nLFxuICAgICAgICAgICBjb250YWluZXI6IHN0cmluZ1xuICAgICAgIH1cbiAgICAqL1xuICAgIGdldCBvbkluaXRTZWdtZW50KCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fb25Jbml0U2VnbWVudDtcbiAgICB9XG5cbiAgICBzZXQgb25Jbml0U2VnbWVudChjYWxsYmFjaykge1xuICAgICAgICB0aGlzLl9vbkluaXRTZWdtZW50ID0gY2FsbGJhY2s7XG4gICAgfVxuXG4gICAgLyogcHJvdG90eXBlOiBmdW5jdGlvbiBvbk1lZGlhU2VnbWVudCh0eXBlOiBzdHJpbmcsIG1lZGlhU2VnbWVudDogTWVkaWFTZWdtZW50KTogdm9pZFxuICAgICAgIE1lZGlhU2VnbWVudDoge1xuICAgICAgICAgICB0eXBlOiBzdHJpbmcsXG4gICAgICAgICAgIGRhdGE6IEFycmF5QnVmZmVyLFxuICAgICAgICAgICBzYW1wbGVDb3VudDogaW50MzJcbiAgICAgICAgICAgaW5mbzogTWVkaWFTZWdtZW50SW5mb1xuICAgICAgIH1cbiAgICAqL1xuICAgIGdldCBvbk1lZGlhU2VnbWVudCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX29uTWVkaWFTZWdtZW50O1xuICAgIH1cblxuICAgIHNldC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9NZXRhID0gbWV0YWRhdGE7XG4gICAgICAgICAgICBtZXRhYm94ID0gTVA0LmdlbmVyYXRlSW5pdFNlZ21lbnQobWV0YWRhdGEpO1xuICAgICAgICAgICAgTG9nLnYoJ21zZythdWRpbycsIG1ldGFkYXRhKTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAndmlkZW8nKSB7XG4gICAgICAgICAgICB0aGlzLl92aWRlb01ldGEgPSBtZXRhZGF0YTtcbiAgICAgICAgICAgIG1ldGFib3ggPSBNUDQuZ2VuZXJhdGVJbml0U2VnbWVudChtZXRhZGF0YSk7XG4gICAgICAgICAgICBMb2cudignbXNnK3ZpZGVvJywgbWV0YWRhdGEpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gZGlzcGF0Y2ggbWV0YWJveCAoSW5pdGlhbGl6YXRpb24gU2VnbWVudClcbiAgICAgICAgaWYgKCF0aGlzLl9vbkluaXRTZWdtZW50KSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCdNUDRSZW11eGVyOiBvbkluaXRTZWdtZW50IGNhbGxiYWNrIG11c3QgYmUgc3BlY2lmaWVkIScpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuX29uSW5pdFNlZ21lbnQodHlwZSwge1xuICAgICAgICAgICAgdHlwZSxcbiAgICAgICAgICAgIGRhdGE6IG1ldGFib3guYnVmZmVyLFxuICAgICAgICAgICAgY29kZWM6IG1ldGFkYXRhLmNvZGVjLFxuICAgICAgICAgICAgY29udGFpbmVyOiBgJHt0eXBlfS9tcDRgXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIF9jYWxjdWxhdGVEdHNCYXNlKGF1ZGlvVHJhY2ssIHZpZGVvVHJhY2spIHtcbiAgICAgICAgaWYgKHRoaXMuX2R0c0Jhc2VJbml0ZWQpIHtcbiAgICAgICAgICAgIHJldHV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4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtdXhTaWxlbnRGcmFtZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsYXN0U2FtcGxlID0gdGhpcy5fYXVkaW9TZWdtZW50SW5mb0xpc3QuZ2V0TGFzdFNhbXBsZUJlZm9yZShvcmlnaW5hbER0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGFzdFNhbXBsZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRpc3RhbmNlID0gKG9yaWdpbmFsRHRzIC0gKGxhc3RTYW1wbGUub3JpZ2luYWxEdHMgKyBsYXN0U2FtcGxlLmR1cmF0aW9uKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpc3RhbmNlIDw9IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzdGFuY2UgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleHBlY3RlZER0cyA9IGxhc3RTYW1wbGUuZHRzICsgbGFzdFNhbXBsZS5kdXJhdGlvbiArIGRpc3RhbmNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR0c0NvcnJlY3Rpb24gPSBvcmlnaW5hbER0cyAtIGV4cGVjdGVkRHRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gbGFzdFNhbXBsZSA9PSBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHRzQ29ycmVjdGlvbiA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBkdHNDb3JyZWN0aW9uID0gb3JpZ2luYWxEdHMgLSB0aGlzLl9hdWRpb05leHREdHM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsZXQgZHRzID0gb3JpZ2luYWxEdHMgLSBkdHNDb3JyZWN0aW9uO1xuICAgICAgICAgICAgaWYgKHJlbXV4U2lsZW50RnJhbWUpIHtcbiAgICAgICAgICAgICAgICAvLyBhbGlnbiBhdWRpbyBzZWdtZW50IGJlZ2luRHRzIHRvIG1hdGNoIHdpdGggY3VycmVudCB2aWRlbyBzZWdtZW50J3MgYmVnaW5EdHNcbiAgICAgICAgICAgICAgICBjb25zdCB2aWRlb1NlZ21lbnQgPSB0aGlzLl92aWRlb1NlZ21lbnRJbmZvTGlzdC5nZXRMYXN0U2VnbWVudEJlZm9yZShvcmlnaW5hbER0cyk7XG4gICAgICAgICAgICAgICAgaWYgKHZpZGVvU2VnbWVudCAhPSBudWxsICYmIHZpZGVvU2VnbWVudC5iZWdpbkR0cyA8IGR0cykge1xuICAgICAgICAgICAgICAgICAgICBzaWxlbnRGcmFtZUR1cmF0aW9uID0gZHRzIC0gdmlkZW9TZWdtZW50LmJlZ2luRHRzO1xuICAgICAgICAgICAgICAgICAgICBkdHMgPSB2aWRlb1NlZ21lbnQuYmVnaW5EdHM7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVtdXhTaWxlbnRGcmFtZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChmaXJzdER0cyA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICBmaXJzdER0cyA9IGR0cztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHJlbXV4U2lsZW50RnJhbWUpIHtcbiAgICAgICAgICAgICAgICByZW11eFNpbGVudEZyYW1lID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgc2FtcGxlcy51bnNoaWZ0KGFhY1NhbXBsZSk7XG5cbiAgICAgICAgICAgICAgICBjb25zdCBmcmFtZSA9IHRoaXMuX2dlbmVyYXRlU2lsZW50QXVkaW8oZHRzLCBzaWxlbnRGcmFtZUR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICBpZiAoZnJhbWUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29uc3QgbXA0U2FtcGxlID0gZnJhbWUubXA0U2FtcGxlO1xuICAgICAgICAgICAgICAgIGNvbnN0IHVuaXQgPSBmcmFtZS51bml0O1xuXG4gICAgICAgICAgICAgICAgbXA0U2FtcGxlcy5wdXNoKG1wNFNhbXBsZSk7XG5cbiAgICAgICAgICAgICAgICAvLyByZS1hbGxvY2F0ZSBtZGF0Ym94IGJ1ZmZlciB3aXRoIG5ldyBzaXplLCB0byBmaXQgd2l0aCB0aGlzIHNpbGVudCBmcmFtZVxuICAgICAgICAgICAgICAgIGJ5dGVzICs9IHVuaXQuYnl0ZUxlbmd0aDtcbiAgICAgICAgICAgICAgICBtZGF0Ym94ID0gbmV3IFVpbnQ4QXJyYXkoYnl0ZXMpO1xuICAgICAgICAgICAgICAgIG1kYXRib3hbMF0gPSAoYnl0ZXMgPj4+IDI0KSAmIDB4RkY7XG4gICAgICAgICAgICAgICAgbWRhdGJveFsxXSA9IChieXRlcyA+Pj4gMTYpICYgMHhGRjtcbiAgICAgICAgICAgICAgICBtZGF0Ym94WzJdID0gKGJ5dGVzID4+PiA4KSAmIDB4RkY7XG4gICAgICAgICAgICAgICAgbWRhdGJveFszXSA9IChieXRlcykgJiAweEZGO1xuICAgICAgICAgICAgICAgIG1kYXRib3guc2V0KE1QNC50eXBlcy5tZGF0LCA0KTtcblxuICAgICAgICAgICAgICAgIC8vIGZpbGwgZGF0YSBub3dcbiAgICAgICAgICAgICAgICBtZGF0Ym94LnNldCh1bml0LCBvZmZzZXQpO1xuICAgICAgICAgICAgICAgIG9mZnNldCArPSB1bml0LmJ5dGVMZW5ndGg7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCBzYW1wbGVEdXJhdGlvbiA9IDA7XG5cbiAgICAgICAgICAgIGlmIChzYW1wbGVzLmxlbmd0aCA+PSAxKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgbmV4dER0cyA9IHNhbXBsZXNbMF0uZHRzIC0gdGhpcy5fZHRzQmFzZSAtIGR0c0NvcnJlY3Rpb247XG4gICAgICAgICAgICAgICAgc2FtcGxlRHVyYXRpb24gPSBuZXh0RHRzIC0gZHRzO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAobXA0U2FtcGxlcy5sZW5ndGggPj0gMSkgeyAvLyB1c2Ugc2Vjb25kIGxhc3Qgc2FtcGxlIGR1cmF0aW9uXG4gICAgICAgICAgICAgICAgICAgIHNhbXBsZUR1cmF0aW9uID0gbXA0U2FtcGxlc1ttcDRTYW1wbGVzLmxlbmd0aCAtIDFdLmR1cmF0aW9uO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8vIHRoZSBvbmx5IG9uZSBzYW1wbGUsIHVzZSByZWZlcmVuY2Ugc2FtcGxlIGR1cmF0aW9uXG4gICAgICAgICAgICAgICAgICAgIHNhbXBsZUR1cmF0aW9uID0gdGhpcy5fYXVkaW9NZXRhLnJlZlNhbXBsZUR1cmF0aW9uO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgbXA0U2FtcGxlID0ge1xuICAgICAgICAgICAgICAgIGR0cyxcbiAgICAgICAgICAgICAgICBwdHM6IGR0cyxcbiAgICAgICAgICAgICAgICBjdHM6IDAsXG4gICAgICAgICAgICAgICAgc2l6ZTogdW5pdC5ieXRlTGVuZ3RoLFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uOiBzYW1wbGVEdXJhdGlvbixcbiAgICAgICAgICAgICAgICBvcmlnaW5hbER0cyxcbiAgICAgICAgICAgICAgICBmbGFnczoge1xuICAgICAgICAgICAgICAgICAgICBpc0xlYWRpbmc6IDAsXG4gICAgICAgICAgICAgICAgICAgIGRlcGVuZHNPbjogMSxcbiAgICAgICAgICAgICAgICAgICAgaXNEZXBlbmRlZE9uOiAwLFxuICAgICAgICAgICAgICAgICAgICBoYXNSZWR1bmRhbmN5OiAwXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIG1wNFNhbXBsZXMucHVzaChtcDRTYW1wbGUpO1xuICAgICAgICAgICAgbWRhdGJveC5zZXQodW5pdCwgb2Zmc2V0KTtcbiAgICAgICAgICAgIG9mZnNldCArPSB1bml0LmJ5dGVMZW5ndGg7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgbGF0ZXN0ID0gbXA0U2FtcGxlc1ttcDRTYW1wbGVzLmxlbmd0aCAtIDFdO1xuICAgICAgICBsYXN0RHRzID0gbGF0ZXN0LmR0cyArIGxhdGVzdC5kdXJhdGlvbjtcbiAgICAgICAgdGhpcy5fYXVkaW9OZXh0RHRzID0gbGFzdER0cztcblxuICAgICAgICAvLyBmaWxsIG1lZGlhIHNlZ21lbnQgaW5mbyAmIGFkZCB0byBpbmZvIGxpc3RcbiAgICAgICAgY29uc3QgaW5mbyA9IG5ldyBNZWRpYVNlZ21lbnRJbmZvKCk7XG4gICAgICAgIGluZm8uYmVnaW5EdHMgPSBmaXJzdER0cztcbiAgICAgICAgaW5mby5lbmREdHMgPSBsYXN0RHRzO1xuICAgICAgICBpbmZvLmJlZ2luUHRzID0gZmlyc3REdHM7XG4gICAgICAgIGluZm8uZW5kUHRzID0gbGFzdER0cztcbiAgICAgICAgaW5mby5vcmlnaW5hbEJlZ2luRHRzID0gbXA0U2FtcGxlc1swXS5vcmlnaW5hbER0cztcbiAgICAgICAgaW5mby5vcmlnaW5hbEVuZER0cyA9IG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VDb3VudDogbXA0U2FtcGxlcy5sZW5ndGgsXG4gICAgICAgICAgICBpbmZvXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIF9nZW5lcmF0ZVNpbGVudEF1ZGlvKGR0cywgZnJhbWVEdXJhdGlvbikge1xuICAgICAgICBMb2cudih0aGlzLlRBRywgYEdlbmVyYXRlU2lsZW50QXVkaW86IGR0cyA9ICR7ZHRzfSwgZHVyYXRpb24gPSAke2ZyYW1lRHVyYXRpb259YCk7XG5cbiAgICAgICAgY29uc3QgdW5pdCA9IEFBQy5nZXRTaWxlbnRGcmFtZSh0aGlzLl9hdWRpb01ldGEuY2hhbm5lbENvdW50KTtcbiAgICAgICAgaWYgKHVuaXQgPT0gbnVsbCkge1xuICAgICAgICAgICAgTG9nLncodGhpcy5UQUcsIGBDYW5ub3QgZ2VuZXJhdGUgc2lsZW50IGFhYyBmcmFtZSBmb3IgY2hhbm5lbENvdW50ID0gJHt0aGlzLl9hdWRpb01ldGEuY2hhbm5lbENvdW50fWApO1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBtcDRTYW1wbGUgPSB7XG4gICAgICAgICAgICBkdHMsXG4gICAgICAgICAgICBwdHM6IGR0cyxcbiAgICAgICAgICAgIGN0czogMCxcbiAgICAgICAgICAgIHNpemU6IHVuaXQuYnl0ZUxlbmd0aCxcbiAgICAgICAgICAgIGR1cmF0aW9uOiBmcmFtZUR1cmF0aW9uLFxuICAgICAgICAgICAgb3JpZ2luYWxEdHM6IGR0cyxcbiAgICAgICAgICAgIGZsYWdzOiB7XG4gICAgICAgICAgICAgICAgaXNMZWFkaW5nOiAwLFxuICAgICAgICAgICAgICAgIGRlcGVuZHNPbjogMSxcbiAgICAgICAgICAgICAgICBpc0RlcGVuZGVkT246IDAsXG4gICAgICAgICAgICAgICAgaGFzUmVkdW5kYW5jeTogMFxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHJldH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SB7XG4gICAgICAgICAgICBjb25zdCBhdmNTYW1wbGUgPSBzYW1wbGVzLnNoaWZ0KCk7XG4gICAgICAgICAgICBjb25zdCBrZXlmcmFtZSA9IGF2Y1NhbXBsZS5pc0tleWZyYW1lO1xuICAgICAgICAgICAgY29uc3Qgb3JpZ2luYWxEdHMgPSBhdmNTYW1wbGUuZHRzIC0gdGhpcy5fZHRzQmFzZTtcblxuICAgICAgICAgICAgaWYgKGR0c0NvcnJlY3Rpb24gPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX3ZpZGVvTmV4dER0cyA9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3ZpZGVvU2VnbWVudEluZm9MaXN0LmlzRW1wdHkoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZHRzQ29ycmVjdGlvbiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsYXN0U2FtcGxlID0gdGhpcy5fdmlkZW9TZWdtZW50SW5mb0xpc3QuZ2V0TGFzdFNhbXBsZUJlZm9yZShvcmlnaW5hbER0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGFzdFNhbXBsZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRpc3RhbmNlID0gKG9yaWdpbmFsRHRzIC0gKGxhc3RTYW1wbGUub3JpZ2luYWxEdHMgKyBsYXN0U2FtcGxlLmR1cmF0aW9uKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpc3RhbmNlIDw9IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzdGFuY2UgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleHBlY3RlZER0cyA9IGxhc3RTYW1wbGUuZHRzICsgbGFzdFNhbXBsZS5kdXJhdGlvbiArIGRpc3RhbmNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR0c0NvcnJlY3Rpb24gPSBvcmlnaW5hbER0cyAtIGV4cGVjdGVkRHRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gbGFzdFNhbXBsZSA9PSBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHRzQ29ycmVjdGlvbiA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBkdHNDb3JyZWN0aW9uID0gb3JpZ2luYWxEdHMgLSB0aGlzLl92aWRlb05leHREdHM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBkdHMgPSBvcmlnaW5hbER0cyAtIGR0c0NvcnJlY3Rpb247XG4gICAgICAgICAgICBjb25zdCBjdHMgPSBhdmNTYW1wbGUuY3RzO1xuICAgICAgICAgICAgY29uc3QgcHRzID0gZHRzICsgY3RzO1xuXG4gICAgICAgICAgICBpZiAoZmlyc3REdHMgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgZmlyc3REdHMgPSBkdHM7XG4gICAgICAgICAgICAgICAgZmlyc3RQdHMgPSBwdHM7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGZpbGwgbWRhdCBib3hcbiAgICAgICAgICAgIGxldCBzYW1wbGVTaXplID0gMDtcbiAgICAgICAgICAgIHdoaWxlIChhdmNTYW1wbGUudW5pdHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgdW5pdCA9IGF2Y1NhbXBsZS51bml0cy5zaGlmdCgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSB1bml0LmRhdGE7XG4gICAgICAgICAgICAgICA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ZHRzLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBzeW5jUG9pbnQuZmlsZXBvc2l0aW9uID0gYXZjU2FtcGxlLmZpbGVwb3NpdGlvbjtcbiAgICAgICAgICAgICAgICBpbmZvLmFwcGVuZFN5bmNQb2ludChzeW5jUG9pbnQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBtcDRTYW1wbGUgPSB7XG4gICAgICAgICAgICAgICAgZHRzLFxuICAgICAgICAgICAgICAgIHB0cyxcbiAgICAgICAgICAgICAgICBjdHMsXG4gICAgICAgICAgICAgICAgc2l6ZTogc2FtcGxlU2l6ZSxcbiAgICAgICAgICAgICAgICBpc0tleWZyYW1lOiBrZXlmcmFtZSxcbiAgICAgICAgICAgICAgICBkdXJhdGlvbjogc2FtcGxlRHVyYXRpb24sXG4gICAgICAgICAgICAgICAgb3JpZ2luYWxEdHMsXG4gICAgICAgICAgICAgICAgZmxhZ3M6IHtcbiAgICAgICAgICAgICAgICAgICAgaXNMZWFkaW5nOiAwLFxuICAgICAgICAgICAgICAgICAgICBkZXBlbmRzT246IGtleWZyYW1lID8gMiA6IDEsXG4gICAgICAgICAgICAgICAgICAgIGlzRGVwZW5kZWRPbjoga2V5ZnJhbWUgPyAxIDogMCxcbiAgICAgICAgICAgICAgICAgICAgaGFzUmVkdW5kYW5jeTogMCxcbiAgICAgICAgICAgICAgICAgICAgaXNOb25TeW5jOiBrZXlmcmFtZSA/IDAgOiAxXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgbXA0U2FtcGxlcy5wdXNoKG1wNFNhbXBsZSk7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgbGF0ZXN0ID0gbXA0U2FtcGxlc1ttcDRTYW1wbGVzLmxlbmd0aCAtIDFdO1xuICAgICAgICBsYXN0RHRzID0gbGF0ZXN0LmR0cyArIGxhdGVzdC5kdXJhdGlvbjtcbiAgICAgICAgbGFzdFB0cyA9IGxhd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V3IFVpbnQ4QXJyYXkobW9vZi5ieXRlTGVuZ3RoICsgbWRhdC5ieXRlTGVuZ3RoKTtcbiAgICAgICAgcmVzdWx0LnNldChtb29mLCAwKTtcbiAgICAgICAgcmVzdWx0LnNldChtZGF0LCBtb29mLmJ5dGVMZW5ndGgpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBNUDRSZW11eGVyO1xuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL2pzL21wNC9tcDRtb29mLmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/*\n * Copyright (C) 2016 Bilibili. All Rights Reserved.\n *\n * @author zheng qian <[email protected]>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable */\nvar Browser = {};\n\nfunction detect() {\n // modified from jquery-browser-plugin\n\n var ua = self.navigator.userAgent.toLowerCase();\n\n var match = /(edge)\\/([\\w.]+)/.exec(ua) || /(opr)[\\/]([\\w.]+)/.exec(ua) || /(chrome)[ \\/]([\\w.]+)/.exec(ua) || /(iemobile)[\\/]([\\w.]+)/.exec(ua) || /(version)(applewebkit)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec(ua) || /(webkit)[ \\/]([\\w.]+).*(version)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec(ua) || /(webkit)[ \\/]([\\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec(ua) || /(msie) ([\\w.]+)/.exec(ua) || ua.indexOf('trident') >= 0 && /(rv)(?::| )([\\w.]+)/.exec(ua) || ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(ua) || [];\n\n var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua) || /(windows phone)/.exec(ua) || /(iphone)/.exec(ua) || /(kindle)/.exec(ua) || /(android)/.exec(ua) || /(windows)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua) || /(cros)/.exec(ua) || [];\n\n var matched = {\n browser: match[5] || match[3] || match[1] || '',\n version: match[2] || match[4] || '0',\n majorVersion: match[4] || match[2] || '0',\n platform: platform_match[0] || ''\n };\n\n var browser = {};\n if (matched.browser) {\n browser[matched.browser] = true;\n\n var versionArray = matched.majorVersion.split('.');\n browser.version = {\n major: parseInt(matched.majorVersion, 10),\n string: matched.version\n };\n if (versionArray.length > 1) {\n browser.version.minor = parseInt(versionArray[1], 10);\n }\n if (versionArray.length > 2) {\n browser.version.build = parseInt(versionArray[2], 10);\n }\n }\n\n if (matched.platform) {\n browser[matched.platform] = true;\n }\n\n if (browser.chrome || browser.opr || browser.safari) {\n browser.webkit = true;\n }\n\n // MSIE. IE11 has 'rv' identifer\n if (browser.rv || browser.iemobile) {\n if (browser.rv) {\n delete browser.rv;\n }\n var msie = 'msie';\n matched.browser = msie;\n browser[msie] = true;\n }\n\n // Microsoft Edge\n if (browser.edge) {\n delete browser.edge;\n var msedge = 'msedge';\n matched.browser = msedge;\n browser[msedge] = true;\n }\n\n // Opera 15+\n if (browser.opr) {\n var opera = 'opera';\n matched.browser = opera;\n browser[opera] = true;\n }\n\n // Stock android browsers are marked as Safari\n if (browser.safari && browser.android) {\n var android = 'android';\n matched.browser = android;\n browser[android] = true;\n }\n\n browser.name = matched.browser;\n browser.platform = matched.platform;\n\n for (var key in Browser) {\n if (Browser.hasOwnProperty(key)) {\n delete Browser[key];\n }\n }\n Object.assign(Browser, browser);\n}\n\ndetect();\n\nexports.default = Browser;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9qcy91dGlscy9icm93c2VyLmpzPzQ3NTkiXSwibmFtZXMiOlsiQnJvd3NlciIsImRldGVjdCIsInVhIiwic2VsZiIsIm5hdmlnYXRvciIsInVzZXJBZ2VudCIsInRvTG93ZXJDYXNlIiwibWF0Y2giLCJleGVjIiwiaW5kZXhPZiIsInBsYXRmb3JtX21hdGNoIiwibWF0Y2hlZCIsImJyb3dzZXIiLCJ2ZXJzaW9uIiwibWFqb3JWZXJzaW9uIiwicGxhdGZvcm0iLCJ2ZXJzaW9uQXJyYXkiLCJzcGxpdCIsIm1ham9yIiwicGFyc2VJbnQiLCJzdHJpbmciLCJsZW5ndGgiLCJtaW5vciIsImJ1aWxkIiwiY2hyb21lIiwib3ByIiwic2FmYXJpIiwid2Via2l0IiwicnYiLCJpZW1vYmlsZSIsIm1zaWUiLCJlZGdlIiwibXNlZGdlIiwib3BlcmEiLCJhbmRyb2lkIiwibmFtZSIsImtleSIsImhhc093blByb3BlcnR5IiwiT2JqZWN0IiwiYXNzaWduIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBOzs7Ozs7Ozs7Ozs7Ozs7OztBQWlCQTtBQUNBLElBQU1BLFVBQVUsRUFBaEI7O0FBRUEsU0FBU0MsTUFBVCxHQUFrQjtBQUNkOztBQUVBLFFBQU1DLEtBQUtDLEtBQUtDLFNBQUwsQ0FBZUMsU0FBZixDQUF5QkMsV0FBekIsRUFBWDs7QUFFQSxRQUFNQyxRQUFRLG1CQUFtQkMsSUFBbkIsQ0FBd0JOLEVBQXhCLEtBQ1Ysb0JBQW9CTSxJQUFwQixDQUF5Qk4sRUFBekIsQ0FEVSxJQUVWLHdCQUF3Qk0sSUFBeEIsQ0FBNkJOLEVBQTdCLENBRlUsSUFHVix5QkFBeUJNLElB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dzZXJdID0gdHJ1ZTtcblxuICAgICAgICBjb25zdCB2ZXJzaW9uQXJyYXkgPSBtYXRjaGVkLm1ham9yVmVyc2lvbi5zcGxpdCgnLicpO1xuICAgICAgICBicm93c2VyLnZlcnNpb24gPSB7XG4gICAgICAgICAgICBtYWpvcjogcGFyc2VJbnQobWF0Y2hlZC5tYWpvclZlcnNpb24sIDEwKSxcbiAgICAgICAgICAgIHN0cmluZzogbWF0Y2hlZC52ZXJzaW9uXG4gICAgICAgIH07XG4gICAgICAgIGlmICh2ZXJzaW9uQXJyYXkubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgYnJvd3Nlci52ZXJzaW9uLm1pbm9yID0gcGFyc2VJbnQodmVyc2lvbkFycmF5WzFdLCAxMCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZlcnNpb25BcnJheS5sZW5ndGggPiAyKSB7XG4gICAgICAgICAgICBicm93c2VyLnZlcnNpb24uYnVpbGQgPSBwYXJzZUludCh2ZXJzaW9uQXJyYXlbMl0sIDEwKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmIChtYXRjaGVkLnBsYXRmb3JtKSB7XG4gICAgICAgIGJyb3dzZXJbbWF0Y2hlZC5wbGF0Zm9ybV0gPSB0cnVlO1xuICAgIH1cblxuICAgIGlmIChicm93c2VyLmNocm9tZSB8fCBicm93c2VyLm9wciB8fCBicm93c2VyLnNhZmFyaSkge1xuICAgICAgICBicm93c2VyLndlYmtpdCA9IHRydWU7XG4gICAgfVxuXG4gICAgLy8gTVNJRS4gSUUxMSBoYXMgJ3J2JyBpZGVudGlmZXJcbiAgICBpZiAoYnJvd3Nlci5ydiB8fCBicm93c2VyLmllbW9iaWxlKSB7XG4gICAgICAgIGlmIChicm93c2VyLnJ2KSB7XG4gICAgICAgICAgICBkZWxldGUgYnJvd3Nlci5ydjtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBtc2llID0gJ21zaWUnO1xuICAgICAgICBtYXRjaGVkLmJyb3dzZ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mplY3QuYXNzaWduKEJyb3dzZXIsIGJyb3dzZXIpO1xufVxuXG5kZXRlY3QoKTtcblxuZXhwb3J0IGRlZmF1bHQgQnJvd3NlcjtcblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9qcy91dGlscy9icm93c2VyLmpzIl0sInNvdXJjZVJvb3QiOiIifQ==");
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(3);
/***/ })
/******/ ]);