|
|
@@ -828,7 +828,7 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- var regenerator = runtime_1;
|
|
|
+ var D__project_vapSource_web_node_modules__babel_runtime_regenerator = runtime_1;
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) {
|
|
|
if (!(instance instanceof Constructor)) {
|
|
|
@@ -972,45 +972,56 @@
|
|
|
|
|
|
var possibleConstructorReturn = _possibleConstructorReturn;
|
|
|
|
|
|
- /*! *****************************************************************************
|
|
|
- Copyright (c) Microsoft Corporation.
|
|
|
-
|
|
|
- Permission to use, copy, modify, and/or distribute this software for any
|
|
|
- purpose with or without fee is hereby granted.
|
|
|
-
|
|
|
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
- PERFORMANCE OF THIS SOFTWARE.
|
|
|
- ***************************************************************************** */
|
|
|
-
|
|
|
- function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
- return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
- step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
- });
|
|
|
+ var getPrototypeOf$1 = createCommonjsModule(function (module) {
|
|
|
+ function _getPrototypeOf(o) {
|
|
|
+ module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
|
+ return o.__proto__ || Object.getPrototypeOf(o);
|
|
|
+ };
|
|
|
+ return _getPrototypeOf(o);
|
|
|
+ }
|
|
|
+
|
|
|
+ module.exports = _getPrototypeOf;
|
|
|
+ });
|
|
|
+
|
|
|
+ /*! *****************************************************************************
|
|
|
+ Copyright (c) Microsoft Corporation.
|
|
|
+
|
|
|
+ Permission to use, copy, modify, and/or distribute this software for any
|
|
|
+ purpose with or without fee is hereby granted.
|
|
|
+
|
|
|
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
+ PERFORMANCE OF THIS SOFTWARE.
|
|
|
+ ***************************************************************************** */
|
|
|
+
|
|
|
+ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
+ return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * Tencent is pleased to support the open source community by making vap available.
|
|
|
- *
|
|
|
- * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
|
|
|
- *
|
|
|
- * Licensed under the MIT License (the "License"); you may not use this file except in
|
|
|
- * compliance with the License. You may obtain a copy of the License at
|
|
|
- *
|
|
|
- * http://opensource.org/licenses/MIT
|
|
|
- *
|
|
|
- * Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
|
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
|
- * either express or implied. See the License for the specific language governing permissions and
|
|
|
- * limitations under the License.
|
|
|
+ /*
|
|
|
+ * Tencent is pleased to support the open source community by making vap available.
|
|
|
+ *
|
|
|
+ * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
|
|
|
+ *
|
|
|
+ * Licensed under the MIT License (the "License"); you may not use this file except in
|
|
|
+ * compliance with the License. You may obtain a copy of the License at
|
|
|
+ *
|
|
|
+ * http://opensource.org/licenses/MIT
|
|
|
+ *
|
|
|
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
|
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
|
+ * either express or implied. See the License for the specific language governing permissions and
|
|
|
+ * limitations under the License.
|
|
|
*/
|
|
|
|
|
|
var FrameParser = /*#__PURE__*/function () {
|
|
|
@@ -1026,8 +1037,8 @@
|
|
|
createClass(FrameParser, [{
|
|
|
key: "init",
|
|
|
value: function init() {
|
|
|
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
|
- return regenerator.wrap(function _callee$(_context) {
|
|
|
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/D__project_vapSource_web_node_modules__babel_runtime_regenerator.mark(function _callee() {
|
|
|
+ return D__project_vapSource_web_node_modules__babel_runtime_regenerator.wrap(function _callee$(_context) {
|
|
|
while (1) {
|
|
|
switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
@@ -1098,10 +1109,10 @@
|
|
|
|
|
|
var src = this.srcData = {};
|
|
|
return Promise.all((dataJson.src || []).map(function (item) {
|
|
|
- return __awaiter(_this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
|
+ return __awaiter(_this, void 0, void 0, /*#__PURE__*/D__project_vapSource_web_node_modules__babel_runtime_regenerator.mark(function _callee2() {
|
|
|
var _this2 = this;
|
|
|
|
|
|
- return regenerator.wrap(function _callee2$(_context2) {
|
|
|
+ return D__project_vapSource_web_node_modules__babel_runtime_regenerator.wrap(function _callee2$(_context2) {
|
|
|
while (1) {
|
|
|
switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
@@ -1165,10 +1176,10 @@
|
|
|
}));
|
|
|
}));
|
|
|
}
|
|
|
- /**
|
|
|
- * 下载json文件
|
|
|
- * @param jsonUrl json外链
|
|
|
- * @returns {Promise}
|
|
|
+ /**
|
|
|
+ * 下载json文件
|
|
|
+ * @param jsonUrl json外链
|
|
|
+ * @returns {Promise}
|
|
|
*/
|
|
|
|
|
|
}, {
|
|
|
@@ -1191,9 +1202,9 @@
|
|
|
xhr.send();
|
|
|
});
|
|
|
}
|
|
|
- /**
|
|
|
- * 文字转换图片
|
|
|
- * @param {*} param0
|
|
|
+ /**
|
|
|
+ * 文字转换图片
|
|
|
+ * @param {*} param0
|
|
|
*/
|
|
|
|
|
|
}, {
|
|
|
@@ -1236,20 +1247,20 @@
|
|
|
return FrameParser;
|
|
|
}();
|
|
|
|
|
|
- /*
|
|
|
- * Tencent is pleased to support the open source community by making vap available.
|
|
|
- *
|
|
|
- * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
|
|
|
- *
|
|
|
- * Licensed under the MIT License (the "License"); you may not use this file except in
|
|
|
- * compliance with the License. You may obtain a copy of the License at
|
|
|
- *
|
|
|
- * http://opensource.org/licenses/MIT
|
|
|
- *
|
|
|
- * Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
|
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
|
- * either express or implied. See the License for the specific language governing permissions and
|
|
|
- * limitations under the License.
|
|
|
+ /*
|
|
|
+ * Tencent is pleased to support the open source community by making vap available.
|
|
|
+ *
|
|
|
+ * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
|
|
|
+ *
|
|
|
+ * Licensed under the MIT License (the "License"); you may not use this file except in
|
|
|
+ * compliance with the License. You may obtain a copy of the License at
|
|
|
+ *
|
|
|
+ * http://opensource.org/licenses/MIT
|
|
|
+ *
|
|
|
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
|
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
|
+ * either express or implied. See the License for the specific language governing permissions and
|
|
|
+ * limitations under the License.
|
|
|
*/
|
|
|
function createShader(gl, type, source) {
|
|
|
var shader = gl.createShader(type);
|
|
|
@@ -1529,7 +1540,7 @@
|
|
|
return VapVideo;
|
|
|
}();
|
|
|
|
|
|
- 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); }; }
|
|
|
+ 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); }; }
|
|
|
|
|
|
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; } }
|
|
|
var clearTimer = null;
|
|
|
@@ -1572,8 +1583,8 @@
|
|
|
createClass(WebglRenderVap, [{
|
|
|
key: "init",
|
|
|
value: function init() {
|
|
|
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
|
- return regenerator.wrap(function _callee$(_context) {
|
|
|
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/D__project_vapSource_web_node_modules__babel_runtime_regenerator.mark(function _callee() {
|
|
|
+ return D__project_vapSource_web_node_modules__babel_runtime_regenerator.wrap(function _callee$(_context) {
|
|
|
while (1) {
|
|
|
switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
@@ -1647,7 +1658,10 @@
|
|
|
gl.enable(gl.BLEND);
|
|
|
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
|
|
- }
|
|
|
+ } // 清除界面,解决同类型type切换MP4时,第一帧是上一个mp4最后一帧的问题
|
|
|
+
|
|
|
+
|
|
|
+ gl.clear(gl.COLOR_BUFFER_BIT);
|
|
|
|
|
|
if (gl) {
|
|
|
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
|
@@ -1670,8 +1684,8 @@
|
|
|
return gl;
|
|
|
}
|
|
|
}
|
|
|
- /**
|
|
|
- * 顶点着色器
|
|
|
+ /**
|
|
|
+ * 顶点着色器
|
|
|
*/
|
|
|
|
|
|
}, {
|
|
|
@@ -1680,8 +1694,8 @@
|
|
|
var gl = this.instance.gl;
|
|
|
return createShader(gl, gl.VERTEX_SHADER, "attribute vec2 a_position; // \u63A5\u53D7\u9876\u70B9\u5750\u6807\n attribute vec2 a_texCoord; // \u63A5\u53D7\u7EB9\u7406\u5750\u6807\n attribute vec2 a_alpha_texCoord; // \u63A5\u53D7\u7EB9\u7406\u5750\u6807\n varying vec2 v_alpha_texCoord; // \u63A5\u53D7\u7EB9\u7406\u5750\u6807\n varying vec2 v_texcoord; // \u4F20\u9012\u7EB9\u7406\u5750\u6807\u7ED9\u7247\u5143\u7740\u8272\u5668\n void main(void){\n gl_Position = vec4(a_position, 0.0, 1.0); // \u8BBE\u7F6E\u5750\u6807\n v_texcoord = a_texCoord; // \u8BBE\u7F6E\u7EB9\u7406\u5750\u6807\n v_alpha_texCoord = a_alpha_texCoord; // \u8BBE\u7F6E\u7EB9\u7406\u5750\u6807\n }");
|
|
|
}
|
|
|
- /**
|
|
|
- * 片元着色器
|
|
|
+ /**
|
|
|
+ * 片元着色器
|
|
|
*/
|
|
|
|
|
|
}, {
|
|
|
@@ -1799,7 +1813,7 @@
|
|
|
var gl = this.instance.gl;
|
|
|
|
|
|
if (!gl) {
|
|
|
- get(getPrototypeOf(WebglRenderVap.prototype), "drawFrame", this).call(this);
|
|
|
+ get(getPrototypeOf$1(WebglRenderVap.prototype), "drawFrame", this).call(this);
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
@@ -1847,7 +1861,7 @@
|
|
|
|
|
|
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
|
|
|
|
|
- get(getPrototypeOf(WebglRenderVap.prototype), "drawFrame", this).call(this);
|
|
|
+ get(getPrototypeOf$1(WebglRenderVap.prototype), "drawFrame", this).call(this);
|
|
|
}
|
|
|
}, {
|
|
|
key: "destroy",
|
|
|
@@ -1867,7 +1881,7 @@
|
|
|
} // glUtil.cleanWebGL(gl, this.shaders, this.program, this.textures, this.buffers)
|
|
|
|
|
|
|
|
|
- get(getPrototypeOf(WebglRenderVap.prototype), "destroy", this).call(this);
|
|
|
+ get(getPrototypeOf$1(WebglRenderVap.prototype), "destroy", this).call(this);
|
|
|
|
|
|
this.clearMemoryCache();
|
|
|
}
|
|
|
@@ -1888,10 +1902,10 @@
|
|
|
}(VapVideo);
|
|
|
|
|
|
var isCanWebGL;
|
|
|
- /**
|
|
|
- * @param options
|
|
|
- * @constructor
|
|
|
- * @return {null}
|
|
|
+ /**
|
|
|
+ * @param options
|
|
|
+ * @constructor
|
|
|
+ * @return {null}
|
|
|
*/
|
|
|
|
|
|
function index (options) {
|