|
244 | 244 |
|
245 | 245 | var possibleConstructorReturn = _possibleConstructorReturn; |
246 | 246 |
|
| 247 | + var getPrototypeOf$1 = createCommonjsModule(function (module) { |
| 248 | + function _getPrototypeOf(o) { |
| 249 | + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { |
| 250 | + return o.__proto__ || Object.getPrototypeOf(o); |
| 251 | + }; |
| 252 | + return _getPrototypeOf(o); |
| 253 | + } |
| 254 | + |
| 255 | + module.exports = _getPrototypeOf; |
| 256 | + }); |
| 257 | + |
| 258 | + var _typeof_1$1 = createCommonjsModule(function (module) { |
| 259 | + function _typeof(obj) { |
| 260 | + "@babel/helpers - typeof"; |
| 261 | + |
| 262 | + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { |
| 263 | + module.exports = _typeof = function _typeof(obj) { |
| 264 | + return typeof obj; |
| 265 | + }; |
| 266 | + } else { |
| 267 | + module.exports = _typeof = function _typeof(obj) { |
| 268 | + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
| 269 | + }; |
| 270 | + } |
| 271 | + |
| 272 | + return _typeof(obj); |
| 273 | + } |
| 274 | + |
| 275 | + module.exports = _typeof; |
| 276 | + }); |
| 277 | + |
247 | 278 | var runtime_1 = createCommonjsModule(function (module) { |
248 | 279 | /** |
249 | 280 | * Copyright (c) 2014-present, Facebook, Inc. |
|
994 | 1025 | } |
995 | 1026 | }); |
996 | 1027 |
|
997 | | - var regenerator = runtime_1; |
| 1028 | + var D__project_vapSource_web_node_modules__babel_runtime_regenerator = runtime_1; |
998 | 1029 |
|
999 | 1030 | /*! ***************************************************************************** |
1000 | 1031 | Copyright (c) Microsoft Corporation. |
|
1050 | 1081 | createClass(FrameParser, [{ |
1051 | 1082 | key: "init", |
1052 | 1083 | value: function init() { |
1053 | | - return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() { |
1054 | | - return regenerator.wrap(function _callee$(_context) { |
| 1084 | + return __awaiter(this, void 0, void 0, /*#__PURE__*/D__project_vapSource_web_node_modules__babel_runtime_regenerator.mark(function _callee() { |
| 1085 | + return D__project_vapSource_web_node_modules__babel_runtime_regenerator.wrap(function _callee$(_context) { |
1055 | 1086 | while (1) { |
1056 | 1087 | switch (_context.prev = _context.next) { |
1057 | 1088 | case 0: |
|
1121 | 1152 |
|
1122 | 1153 | var src = this.srcData = {}; |
1123 | 1154 | return Promise.all((dataJson.src || []).map(function (item) { |
1124 | | - return __awaiter(_this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() { |
| 1155 | + return __awaiter(_this, void 0, void 0, /*#__PURE__*/D__project_vapSource_web_node_modules__babel_runtime_regenerator.mark(function _callee2() { |
1125 | 1156 | var _this2 = this; |
1126 | 1157 |
|
1127 | | - return regenerator.wrap(function _callee2$(_context2) { |
| 1158 | + return D__project_vapSource_web_node_modules__babel_runtime_regenerator.wrap(function _callee2$(_context2) { |
1128 | 1159 | while (1) { |
1129 | 1160 | switch (_context2.prev = _context2.next) { |
1130 | 1161 | case 0: |
|
1261 | 1292 | } else if (typeof fontStyle == 'string') { |
1262 | 1293 | ctx.font = fontStyle; |
1263 | 1294 | ctx.fillStyle = color; |
1264 | | - } else if (_typeof_1(fontStyle) == 'object') { |
| 1295 | + } else if (_typeof_1$1(fontStyle) == 'object') { |
1265 | 1296 | ctx.font = fontStyle['font'] || getFontStyle(); |
1266 | 1297 | ctx.fillStyle = fontStyle['color'] || color; |
1267 | 1298 | } else if (typeof fontStyle == 'function') { |
|
1722 | 1753 | return VapVideo; |
1723 | 1754 | }(); |
1724 | 1755 |
|
1725 | | - function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn(this, result); }; } |
| 1756 | + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf$1(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf$1(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn(this, result); }; } |
1726 | 1757 |
|
1727 | 1758 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } |
1728 | 1759 | var PER_SIZE = 9; |
|
1781 | 1812 |
|
1782 | 1813 | _this2.options.fps = _this2.vapFrameParser.config.info.fps || 30; |
1783 | 1814 |
|
1784 | | - get(getPrototypeOf(WebglRenderVap.prototype), "play", _this2).call(_this2); |
| 1815 | + get(getPrototypeOf$1(WebglRenderVap.prototype), "play", _this2).call(_this2); |
1785 | 1816 | })["catch"](function (e) { |
1786 | 1817 | _this2.vapFrameParser = null; |
1787 | 1818 | console.error('[Alpha video] parse vap frame error.', e); |
1788 | 1819 | return _this2; |
1789 | 1820 | }); |
1790 | 1821 | } else { |
1791 | | - get(getPrototypeOf(WebglRenderVap.prototype), "play", this).call(this); |
| 1822 | + get(getPrototypeOf$1(WebglRenderVap.prototype), "play", this).call(this); |
1792 | 1823 | } |
1793 | 1824 |
|
1794 | 1825 | return this; |
|
1801 | 1832 | vertexShader = this.vertexShader, |
1802 | 1833 | fragmentShader = this.fragmentShader, |
1803 | 1834 | program = this.program; |
| 1835 | + var _this$options = this.options, |
| 1836 | + width = _this$options.width, |
| 1837 | + height = _this$options.height; |
1804 | 1838 |
|
1805 | 1839 | if (!canvas) { |
1806 | 1840 | canvas = document.createElement('canvas'); |
|
1810 | 1844 | var _vapFrameParser$confi = vapFrameParser.config.info, |
1811 | 1845 | w = _vapFrameParser$confi.w, |
1812 | 1846 | h = _vapFrameParser$confi.h; |
1813 | | - canvas.width = w; |
1814 | | - canvas.height = h; |
| 1847 | + canvas.width = width || w; |
| 1848 | + canvas.height = height || h; |
1815 | 1849 | this.container.appendChild(canvas); |
1816 | 1850 |
|
1817 | 1851 | if (!gl) { |
|
1821 | 1855 | gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); |
1822 | 1856 | } |
1823 | 1857 |
|
1824 | | - gl.viewport(0, 0, w, h); |
| 1858 | + gl.viewport(0, 0, canvas.width, canvas.height); |
1825 | 1859 |
|
1826 | 1860 | if (!vertexShader) { |
1827 | 1861 | vertexShader = this.initVertexShader(gl); |
|
1982 | 2016 | options = this.options; |
1983 | 2017 |
|
1984 | 2018 | if (!gl) { |
1985 | | - get(getPrototypeOf(WebglRenderVap.prototype), "drawFrame", this).call(this, _, info); |
| 2019 | + get(getPrototypeOf$1(WebglRenderVap.prototype), "drawFrame", this).call(this, _, info); |
1986 | 2020 |
|
1987 | 2021 | return; |
1988 | 2022 | } |
|
2038 | 2072 |
|
2039 | 2073 | gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); |
2040 | 2074 |
|
2041 | | - get(getPrototypeOf(WebglRenderVap.prototype), "drawFrame", this).call(this, _, info); |
| 2075 | + get(getPrototypeOf$1(WebglRenderVap.prototype), "drawFrame", this).call(this, _, info); |
2042 | 2076 | } // 清理数据,为下一次播放做准备 |
2043 | 2077 |
|
2044 | 2078 | }, { |
2045 | 2079 | key: "clear", |
2046 | 2080 | value: function clear() { |
2047 | | - get(getPrototypeOf(WebglRenderVap.prototype), "clear", this).call(this); |
| 2081 | + get(getPrototypeOf$1(WebglRenderVap.prototype), "clear", this).call(this); |
2048 | 2082 |
|
2049 | 2083 | var gl = this.gl; // 清除界面,解决连续播放时,第一帧是上一个mp4最后一帧的问题 |
2050 | 2084 |
|
|
2054 | 2088 | }, { |
2055 | 2089 | key: "destroy", |
2056 | 2090 | value: function destroy() { |
2057 | | - get(getPrototypeOf(WebglRenderVap.prototype), "destroy", this).call(this); |
| 2091 | + get(getPrototypeOf$1(WebglRenderVap.prototype), "destroy", this).call(this); |
2058 | 2092 |
|
2059 | 2093 | var canvas = this.canvas, |
2060 | 2094 | gl = this.gl, |
|
0 commit comments