-
Notifications
You must be signed in to change notification settings - Fork 0
/
video.js
100 lines (96 loc) · 23.9 KB
/
video.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
/******/ (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;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // 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 = "./app/video.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./app/video.js":
/*!**********************!*\
!*** ./app/video.js ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("!function (window) {\n\n // 验证类型\n const Verify = new Function();\n Verify.prototype = {\n constructor: Verify,\n isWindow(obj) {\n return obj !== null && obj === obj.window;\n },\n isObject(obj) {\n return obj !== null && typeof obj === 'object';\n },\n isFunction(fun) {\n return fun !== null && typeof fun === 'function';\n }\n };\n\n // 实例化\n let inseart = true;\n\n // 方法\n const Methods = function (config) {\n this.verify = new Verify();\n if (!this.verify.isObject(config)) {\n return false;\n }\n return this;\n };\n Methods.prototype = {\n constructor: Methods,\n init(config, canplay, play, update, end) {\n\n this.canvasObj = this.createCanvas(config['el'].offsetWidth, config['el'].offsetHeight);\n\n if (config['imageUrl']) {\n\n const image = this.createImage(config['imageUrl']);\n\n image.onload = () => {\n this.canvasObj['context'].drawImage(image, 0, 0, this.canvasObj['width'], this.canvasObj['height']);\n };\n };\n\n this.createVideo(config, canplay, play, update, end);\n\n config['el'].appendChild(this.canvasObj.canvas);\n },\n createCanvas(width, height) {\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n canvas.width = width;\n canvas.height = height;\n context.clearRect(0, 0, canvas.width, canvas.height);\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n return { canvas, context, width: canvas.width, height: canvas.height };\n },\n createImage(imageUrl) {\n const image = new Image();\n image.src = imageUrl;\n return image;\n },\n createVideo(config, canplay, play, update, end) {\n const video = document.createElement('video');\n video.setAttribute('src', config['videoUrl']);\n video.setAttribute('webkit-playsinline', 'true');\n video.setAttribute('controls', 'controls');\n video.setAttribute('playsinline', 'true');\n video.setAttribute('x-webkit-airplay', 'true');\n video.setAttribute('x5-video-player-type', 'h5');\n video.setAttribute('x5-video-player-fullscreen', 'true');\n video.setAttribute('x5-video-ignore-metadata', 'true');\n video.style.objectFit = 'cover';\n video.style.objectPosition = 'center';\n video.style.width = '100%';\n if (config['audioUrl']) {\n this.createAudio();\n video.muted = true;\n }\n\n let time = '';\n\n const videoHandler = {\n play: video.play.bind(video),\n pause: video.pause.bind(video),\n load: video.load.bind(video),\n setAudio: this.setAudio.bind(this),\n currentTime: sec => {\n video.currentTime = sec;\n this.audio.currentTime = sec;\n }\n };\n\n video.addEventListener('canplaythrough', () => {\n if (this.verify.isFunction(canplay)) {\n canplay(videoHandler);\n }\n });\n\n video.addEventListener('play', () => {\n if (this.verify.isFunction(play)) {\n play(videoHandler);\n }\n\n this.setAudio(config['audioUrl']);\n time = setInterval(() => {\n this.canvasObj['context'].drawImage(video, 0, 0, this.canvasObj['width'], this.canvasObj['height']);\n }, 20);\n });\n\n video.addEventListener(\"timeupdate\", () => {\n const plan = video.currentTime;\n if (this.verify.isFunction(update)) {\n update(videoHandler, plan);\n }\n }, false);\n\n video.addEventListener('ended', () => {\n clearInterval(time);\n if (this.verify.isFunction(end)) {\n end(videoHandler);\n }\n });\n },\n createAudio() {\n this.audio = document.createElement('audio');\n },\n setAudio(audioUrl) {\n this.audio.setAttribute('src', audioUrl);\n this.audio.play();\n }\n };\n\n const mobVideo = function (config) {\n\n this.verify = new Verify();\n\n if (!this.verify.isWindow(window)) {\n return false;\n };\n\n if (!inseart) {\n throw new Error('只能创建一次');\n return false;\n } else {\n inseart = false;\n };\n\n if (!this.verify.isObject(config)) {\n throw new Error('第一个参数必须是对象');\n };\n\n if (!config['el'] || document.getElementById(config['el']) === null) {\n throw new Error('没有配置id或没有找到id元素');\n };\n\n if (!config['videoUrl']) {\n throw new Error('没有配置视频地址');\n };\n\n config['el'] = document.getElementById(config['el']);\n\n this.config = config;\n\n this.initInseart = true;\n\n return this;\n };\n\n mobVideo.prototype = {\n constructor: mobVideo,\n init(canplay, play, update, end) {\n\n if (!this.initInseart) {\n throw new Error('只能初始化一次');\n return false;\n }\n\n this.initInseart = false;\n\n const methods = new Methods();\n methods.init(this.config, canplay, play, update, end);\n }\n };\n\n window.mobVideo = mobVideo;\n}(window);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hcHAvdmlkZW8uanM/NjVhNCJdLCJuYW1lcyI6WyJ3aW5kb3ciLCJWZXJpZnkiLCJGdW5jdGlvbiIsInByb3RvdHlwZSIsImNvbnN0cnVjdG9yIiwiaXNXaW5kb3ciLCJvYmoiLCJpc09iamVjdCIsImlzRnVuY3Rpb24iLCJmdW4iLCJpbnNlYXJ0IiwiTWV0aG9kcyIsImNvbmZpZyIsInZlcmlmeSIsImluaXQiLCJjYW5wbGF5IiwicGxheSIsInVwZGF0ZSIsImVuZCIsImNhbnZhc09iaiIsImNyZWF0ZUNhbnZhcyIsIm9mZnNldFdpZHRoIiwib2Zmc2V0SGVpZ2h0IiwiaW1hZ2UiLCJjcmVhdGVJbWFnZ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JcbiAgICAgIH0pO1xyXG5cclxuICAgICAgdmlkZW8uYWRkRXZlbnRMaXN0ZW5lcigncGxheScsICgpID0+IHtcclxuICAgICAgICBpZiAodGhpcy52ZXJpZnkuaXNGdW5jdGlvbihwbGF5KSkge1xyXG4gICAgICAgICAgcGxheSh2aWRlb0hhbmRsZXIpO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgdGhpcy5zZXRBdWRpbyhjb25maWdbJ2F1ZGlvVXJsJ10pXHJcbiAgICAgICAgdGltZSA9IHNldEludGVydmFsKCgpID0+IHtcclxuICAgICAgICAgIHRoaXMuY2FudmFzT2JqWydjb250ZXh0J10uZHJhd0ltYWdlKHZpZGVvLCAwLCAwLCB0aGlzLmNhbnZhc09ialsnd2lkdGgnXSwgdGhpcy5jYW52YXNPYmpbJ2hlaWdodCddKTtcclxuICAgICAgICB9LCAyMClcclxuICAgICAgfSlcclxuXHJcbiAgICAgIHZpZGVvLmFkZEV2ZW50TGlzdGVuZXIoXCJ0aW1ldXBkYXRlXCIsICgpID0+IHtcclxuICAgICAgICBjb25zdCBwbGFuID0gdmlkZW8uY3VycmVudFRpbWU7XHJcbiAgICAgICAgaWYgKHRoaXMudmVyaWZ5LmlzRnVuY3Rpb24odXBkYXRlKSkge1xyXG4gICAgICAgICAgdXBkYXRlKHZpZGVvSGFuZGxlciwgcGxhbik7XHJcbiAgICAgICAgfVxyXG4gICAgICB9LCBmYWxzZSk7XHJcblxyXG4gICAgICB2aWRlby5hZGRFdmVudExpc3RlbmVyKCdlbmRlZCcsICgpID0+IHtcclxuICAgICAgICBjbGVhckludGVydmFsKHRpbWUpO1xyXG4gICAgICAgIGlmICh0aGlzLnZlcmlmeS5pc0Z1bmN0aW9uKGVuZCkpIHtcclxuICAgICAgICAgIGVuZCh2aWRlb0hhbmRsZXIpO1xyXG4gICAgICAgIH1cclxuICAgICAgfSlcclxuICAgIH0sXHJcbiAgICBjcmVhdGVBdWRpbyAoKSB7XHJcbiAgICAgIHRoaX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mV3IEVycm9yKCfmsqHmnInphY3nva7op4bpopHlnLDlnYAnKTtcclxuICAgIH07XHJcblxyXG4gICAgY29uZmlnWydlbCddID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoY29uZmlnWydlbCddKTtcclxuXHJcbiAgICB0aGlzLmNvbmZpZyA9IGNvbmZpZztcclxuXHJcbiAgICB0aGlzLmluaXRJbnNlYXJ0ID0gdHJ1ZTtcclxuXHJcbiAgICByZXR1cm4gdGhpcztcclxuICAgIFxyXG4gIH07XHJcblxyXG4gIG1vYlZpZGVvLnByb3RvdHlwZSA9IHtcclxuICAgIGNvbnN0cnVjdG9yOiBtb2JWaWRlbyxcclxuICAgIGluaXQgKGNhbnBsYXksIHBsYXksIHVwZGF0ZSwgZW5kKSB7XHJcblxyXG4gICAgICBpZiAoIXRoaXMuaW5pdEluc2VhcnQpIHtcclxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ+WPquiDveWIneWni+WMluS4gOasoScpO1xyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgfVxyXG5cclxuICAgICAgdGhpcy5pbml0SW5zZWFydCA9IGZhbHNlO1xyXG5cclxuICAgICAgY29uc3QgbWV0aG9kcyA9IG5ldyBNZXRob2RzKCk7XHJcbiAgICAgIG1ldGhvZHMuaW5pdCh0aGlzLmNvbmZpZywgY2FucGxheSwgcGxheSwgdXBkYXRlLCBlbmQpO1xyXG5cclxuICAgIH1cclxuICB9XHJcblxyXG4gIHdpbmRvdy5tb2JWaWRlbyA9IG1vYlZpZGVvO1xyXG5cclxufSkod2luZG93KTsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./app/video.js\n");
/***/ })
/******/ });