Showing
5 changed files
with
63 additions
and
7 deletions
1 | +/* eslint-disable no-console */ | ||
2 | +import getBlobDuration from "get-blob-duration"; | ||
3 | + | ||
1 | const videoContainer = document.getElementById("jsVideoPlayer"); | 4 | const videoContainer = document.getElementById("jsVideoPlayer"); |
2 | const videoPlayer = document.querySelector("#jsVideoPlayer video"); | 5 | const videoPlayer = document.querySelector("#jsVideoPlayer video"); |
3 | const playBtn = document.getElementById("jsPlayButton"); | 6 | const playBtn = document.getElementById("jsPlayButton"); |
... | @@ -89,8 +92,12 @@ const formatDate = (seconds) => { | ... | @@ -89,8 +92,12 @@ const formatDate = (seconds) => { |
89 | function getCurrentTime() { | 92 | function getCurrentTime() { |
90 | currentTime.innerHTML = formatDate(Math.floor(videoPlayer.currentTime)); | 93 | currentTime.innerHTML = formatDate(Math.floor(videoPlayer.currentTime)); |
91 | } | 94 | } |
92 | -function setTotalTime() { | 95 | + |
93 | - const totalTimeString = formatDate(videoPlayer.duration); | 96 | +async function setTotalTime() { |
97 | + const blob = await fetch(videoPlayer.src).then((response) => response.blob()); | ||
98 | + const duration = await getBlobDuration(blob); | ||
99 | + console.log(duration); | ||
100 | + const totalTimeString = formatDate(duration); | ||
94 | totalTime.innerHTML = totalTimeString; | 101 | totalTime.innerHTML = totalTimeString; |
95 | setInterval(getCurrentTime, 1000); | 102 | setInterval(getCurrentTime, 1000); |
96 | } | 103 | } | ... | ... |
... | @@ -4,7 +4,7 @@ import dotenv from "dotenv"; | ... | @@ -4,7 +4,7 @@ import dotenv from "dotenv"; |
4 | 4 | ||
5 | dotenv.config(); | 5 | dotenv.config(); |
6 | 6 | ||
7 | -mongoose.connect(process.env.MONGO_URL, { | 7 | +mongoose.connect(process.env.MONGO_URL_PROD, { |
8 | useNewUrlParser: true, | 8 | useNewUrlParser: true, |
9 | useFindAndModify: false, | 9 | useFindAndModify: false, |
10 | }); | 10 | }); | ... | ... |
... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
16 | "author": "Kang Yeon Wook", | 16 | "author": "Kang Yeon Wook", |
17 | "license": "ISC", | 17 | "license": "ISC", |
18 | "dependencies": { | 18 | "dependencies": { |
19 | + "@babel/cli": "^7.10.3", | ||
19 | "@babel/core": "^7.9.6", | 20 | "@babel/core": "^7.9.6", |
20 | "@babel/node": "^7.8.7", | 21 | "@babel/node": "^7.8.7", |
21 | "@babel/polyfill": "^7.10.1", | 22 | "@babel/polyfill": "^7.10.1", |
... | @@ -32,6 +33,7 @@ | ... | @@ -32,6 +33,7 @@ |
32 | "express": "^4.17.1", | 33 | "express": "^4.17.1", |
33 | "express-session": "^1.17.1", | 34 | "express-session": "^1.17.1", |
34 | "extract-text-webpack-plugin": "^4.0.0-beta.0", | 35 | "extract-text-webpack-plugin": "^4.0.0-beta.0", |
36 | + "get-blob-duration": "^1.1.1", | ||
35 | "helmet": "^3.22.0", | 37 | "helmet": "^3.22.0", |
36 | "mongoose": "^5.9.15", | 38 | "mongoose": "^5.9.15", |
37 | "morgan": "^1.10.0", | 39 | "morgan": "^1.10.0", | ... | ... |
... | @@ -106,7 +106,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axio | ... | @@ -106,7 +106,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axio |
106 | /***/ (function(module, __webpack_exports__, __webpack_require__) { | 106 | /***/ (function(module, __webpack_exports__, __webpack_require__) { |
107 | 107 | ||
108 | "use strict"; | 108 | "use strict"; |
109 | -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scss_styles_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scss/styles.scss */ \"./assets/scss/styles.scss\");\n/* harmony import */ var _scss_styles_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_scss_styles_scss__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _videoPlayer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./videoPlayer */ \"./assets/js/videoPlayer.js\");\n/* harmony import */ var _videoPlayer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_videoPlayer__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _videoRecorder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./videoRecorder */ \"./assets/js/videoRecorder.js\");\n/* harmony import */ var _videoRecorder__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_videoRecorder__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _addComment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./addComment */ \"./assets/js/addComment.js\");\n\n\n\n\n\n\n//# sourceURL=webpack:///./assets/js/main.js?"); | 109 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scss_styles_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scss/styles.scss */ \"./assets/scss/styles.scss\");\n/* harmony import */ var _scss_styles_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_scss_styles_scss__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _videoPlayer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./videoPlayer */ \"./assets/js/videoPlayer.js\");\n/* harmony import */ var _videoRecorder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./videoRecorder */ \"./assets/js/videoRecorder.js\");\n/* harmony import */ var _videoRecorder__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_videoRecorder__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _addComment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./addComment */ \"./assets/js/addComment.js\");\n\n\n\n\n\n\n//# sourceURL=webpack:///./assets/js/main.js?"); |
110 | 110 | ||
111 | /***/ }), | 111 | /***/ }), |
112 | 112 | ||
... | @@ -114,10 +114,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scs | ... | @@ -114,10 +114,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scs |
114 | /*!**********************************!*\ | 114 | /*!**********************************!*\ |
115 | !*** ./assets/js/videoPlayer.js ***! | 115 | !*** ./assets/js/videoPlayer.js ***! |
116 | \**********************************/ | 116 | \**********************************/ |
117 | -/*! no static exports found */ | 117 | +/*! no exports provided */ |
118 | -/***/ (function(module, exports) { | 118 | +/***/ (function(module, __webpack_exports__, __webpack_require__) { |
119 | 119 | ||
120 | -eval("const videoContainer = document.getElementById(\"jsVideoPlayer\");\nconst videoPlayer = document.querySelector(\"#jsVideoPlayer video\");\nconst playBtn = document.getElementById(\"jsPlayButton\");\nconst volumeBtn = document.getElementById(\"jsVolumeBtn\");\nconst fullScrnBtn = document.getElementById(\"jsFullScreen\");\nconst currentTime = document.getElementById(\"currentTime\");\nconst totalTime = document.getElementById(\"totalTime\");\nconst volumeRange = document.getElementById(\"jsVolume\");\n\nconst registerView = () => {\n const id = window.location.href.split(\"/videos/\")[1];\n fetch(`/api/${id}/view`, {\n method: \"POST\",\n });\n};\n\n// video element MDN\n// using MDN (Mozila Developer Networks)\nfunction handlePlayClick() {\n if (videoPlayer.paused) {\n videoPlayer.play();\n playBtn.innerHTML = '<i class=\"fas fa-pause\"></i>';\n } else {\n videoPlayer.pause();\n playBtn.innerHTML = '<i class=\"fas fa-play\"></i>';\n }\n}\nfunction handleVolumeClick() {\n if (videoPlayer.muted) {\n videoPlayer.muted = false;\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-up\"></i>';\n volumeRange.value = videoPlayer.volume;\n } else {\n volumeRange.value = 0;\n videoPlayer.muted = true;\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-mute\"></i>';\n }\n}\n\nfunction exitFullScreen() {\n fullScrnBtn.innerHTML = '<i class=\"fas fa-expand\"></i>';\n fullScrnBtn.removeEventListener(\"click\", exitFullScreen);\n fullScrnBtn.addEventListener(\"click\", goFullScreen);\n\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mxExitFullscreen) {\n document.mxExitFullscreen();\n }\n}\n\nfunction goFullScreen() {\n if (videoContainer.requestFullscreen) {\n videoContainer.requestFullscreen();\n } else if (videoContainer.mozRequestFullScreen) {\n videoContainer.mozRequestFullScreen();\n } else if (videoContainer.webkitRequestFullscreen) {\n videoContainer.webkitRequestFullscreen();\n } else if (videoContainer.msRequestFullscreen) {\n videoContainer.msRequestFullscreen();\n }\n\n fullScrnBtn.innerHTML = '<i class=\"fas fa-compress\"></i>';\n fullScrnBtn.removeEventListener(\"click\", goFullScreen);\n fullScrnBtn.addEventListener(\"click\", exitFullScreen);\n}\nconst formatDate = (seconds) => {\n const secondsNumber = parseInt(seconds, 10);\n let hours = Math.floor(secondsNumber / 3600);\n let minutes = Math.floor((secondsNumber - hours * 3600) / 60);\n let totalSeconds = secondsNumber - hours * 3600 - minutes * 60;\n\n if (hours < 10) {\n hours = `0${hours}`;\n }\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n if (totalSeconds < 10) {\n totalSeconds = `0${totalSeconds}`;\n }\n return `${hours}:${minutes}:${totalSeconds}`;\n};\n\nfunction getCurrentTime() {\n currentTime.innerHTML = formatDate(Math.floor(videoPlayer.currentTime));\n}\nfunction setTotalTime() {\n const totalTimeString = formatDate(videoPlayer.duration);\n totalTime.innerHTML = totalTimeString;\n setInterval(getCurrentTime, 1000);\n}\n\n// 영상이 끝나면 pause하고 다시 앞으로 돌릴 수 있게 하고 싶다...\nfunction handleEnded() {\n registerView();\n videoPlayer.currentTime = 0;\n playBtn.innerHTML = '<i class=\"fas fa-play\"></i>';\n}\nfunction handleDrag(event) {\n const {\n target: { value },\n } = event;\n videoPlayer.volume = value;\n if (value >= 0.6) {\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-up\"></i>';\n } else if (value >= 0.2) {\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-down\"></i>';\n } else {\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-mute\"></i>';\n }\n}\n\nfunction init() {\n videoPlayer.volume = 0.5;\n playBtn.addEventListener(\"click\", handlePlayClick);\n volumeBtn.addEventListener(\"click\", handleVolumeClick);\n fullScrnBtn.addEventListener(\"click\", goFullScreen);\n videoPlayer.addEventListener(\"loadedmetadata\", setTotalTime);\n videoPlayer.addEventListener(\"ended\", handleEnded);\n volumeRange.addEventListener(\"input\", handleDrag);\n}\n\nif (videoContainer) {\n init();\n} // 안 해주면 다른 페이지에서도 js 읽히므로..\n\n\n//# sourceURL=webpack:///./assets/js/videoPlayer.js?"); | 120 | +"use strict"; |
121 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var get_blob_duration__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! get-blob-duration */ \"./node_modules/get-blob-duration/dist/getBlobDuration.js\");\n/* harmony import */ var get_blob_duration__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(get_blob_duration__WEBPACK_IMPORTED_MODULE_0__);\n/* eslint-disable no-console */\n\n\nconst videoContainer = document.getElementById(\"jsVideoPlayer\");\nconst videoPlayer = document.querySelector(\"#jsVideoPlayer video\");\nconst playBtn = document.getElementById(\"jsPlayButton\");\nconst volumeBtn = document.getElementById(\"jsVolumeBtn\");\nconst fullScrnBtn = document.getElementById(\"jsFullScreen\");\nconst currentTime = document.getElementById(\"currentTime\");\nconst totalTime = document.getElementById(\"totalTime\");\nconst volumeRange = document.getElementById(\"jsVolume\");\n\nconst registerView = () => {\n const id = window.location.href.split(\"/videos/\")[1];\n fetch(`/api/${id}/view`, {\n method: \"POST\",\n });\n};\n\n// video element MDN\n// using MDN (Mozila Developer Networks)\nfunction handlePlayClick() {\n if (videoPlayer.paused) {\n videoPlayer.play();\n playBtn.innerHTML = '<i class=\"fas fa-pause\"></i>';\n } else {\n videoPlayer.pause();\n playBtn.innerHTML = '<i class=\"fas fa-play\"></i>';\n }\n}\nfunction handleVolumeClick() {\n if (videoPlayer.muted) {\n videoPlayer.muted = false;\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-up\"></i>';\n volumeRange.value = videoPlayer.volume;\n } else {\n volumeRange.value = 0;\n videoPlayer.muted = true;\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-mute\"></i>';\n }\n}\n\nfunction exitFullScreen() {\n fullScrnBtn.innerHTML = '<i class=\"fas fa-expand\"></i>';\n fullScrnBtn.removeEventListener(\"click\", exitFullScreen);\n fullScrnBtn.addEventListener(\"click\", goFullScreen);\n\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mxExitFullscreen) {\n document.mxExitFullscreen();\n }\n}\n\nfunction goFullScreen() {\n if (videoContainer.requestFullscreen) {\n videoContainer.requestFullscreen();\n } else if (videoContainer.mozRequestFullScreen) {\n videoContainer.mozRequestFullScreen();\n } else if (videoContainer.webkitRequestFullscreen) {\n videoContainer.webkitRequestFullscreen();\n } else if (videoContainer.msRequestFullscreen) {\n videoContainer.msRequestFullscreen();\n }\n\n fullScrnBtn.innerHTML = '<i class=\"fas fa-compress\"></i>';\n fullScrnBtn.removeEventListener(\"click\", goFullScreen);\n fullScrnBtn.addEventListener(\"click\", exitFullScreen);\n}\nconst formatDate = (seconds) => {\n const secondsNumber = parseInt(seconds, 10);\n let hours = Math.floor(secondsNumber / 3600);\n let minutes = Math.floor((secondsNumber - hours * 3600) / 60);\n let totalSeconds = secondsNumber - hours * 3600 - minutes * 60;\n\n if (hours < 10) {\n hours = `0${hours}`;\n }\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n if (totalSeconds < 10) {\n totalSeconds = `0${totalSeconds}`;\n }\n return `${hours}:${minutes}:${totalSeconds}`;\n};\n\nfunction getCurrentTime() {\n currentTime.innerHTML = formatDate(Math.floor(videoPlayer.currentTime));\n}\n\nasync function setTotalTime() {\n const blob = await fetch(videoPlayer.src).then((response) => response.blob());\n const duration = await get_blob_duration__WEBPACK_IMPORTED_MODULE_0___default()(blob);\n console.log(duration);\n const totalTimeString = formatDate(duration);\n totalTime.innerHTML = totalTimeString;\n setInterval(getCurrentTime, 1000);\n}\n\n// 영상이 끝나면 pause하고 다시 앞으로 돌릴 수 있게 하고 싶다...\nfunction handleEnded() {\n registerView();\n videoPlayer.currentTime = 0;\n playBtn.innerHTML = '<i class=\"fas fa-play\"></i>';\n}\nfunction handleDrag(event) {\n const {\n target: { value },\n } = event;\n videoPlayer.volume = value;\n if (value >= 0.6) {\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-up\"></i>';\n } else if (value >= 0.2) {\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-down\"></i>';\n } else {\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-mute\"></i>';\n }\n}\n\nfunction init() {\n videoPlayer.volume = 0.5;\n playBtn.addEventListener(\"click\", handlePlayClick);\n volumeBtn.addEventListener(\"click\", handleVolumeClick);\n fullScrnBtn.addEventListener(\"click\", goFullScreen);\n videoPlayer.addEventListener(\"loadedmetadata\", setTotalTime);\n videoPlayer.addEventListener(\"ended\", handleEnded);\n volumeRange.addEventListener(\"input\", handleDrag);\n}\n\nif (videoContainer) {\n init();\n} // 안 해주면 다른 페이지에서도 js 읽히므로..\n\n\n//# sourceURL=webpack:///./assets/js/videoPlayer.js?"); | ||
121 | 122 | ||
122 | /***/ }), | 123 | /***/ }), |
123 | 124 | ||
... | @@ -3599,6 +3600,39 @@ eval("__webpack_require__(/*! ../modules/web.timers */ \"./node_modules/@babel/p | ... | @@ -3599,6 +3600,39 @@ eval("__webpack_require__(/*! ../modules/web.timers */ \"./node_modules/@babel/p |
3599 | 3600 | ||
3600 | /***/ }), | 3601 | /***/ }), |
3601 | 3602 | ||
3603 | +/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js": | ||
3604 | +/*!*****************************************************************!*\ | ||
3605 | + !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! | ||
3606 | + \*****************************************************************/ | ||
3607 | +/*! no static exports found */ | ||
3608 | +/***/ (function(module, exports) { | ||
3609 | + | ||
3610 | +eval("function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js?"); | ||
3611 | + | ||
3612 | +/***/ }), | ||
3613 | + | ||
3614 | +/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js": | ||
3615 | +/*!**********************************************************************!*\ | ||
3616 | + !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | ||
3617 | + \**********************************************************************/ | ||
3618 | +/*! no static exports found */ | ||
3619 | +/***/ (function(module, exports) { | ||
3620 | + | ||
3621 | +eval("function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/interopRequireDefault.js?"); | ||
3622 | + | ||
3623 | +/***/ }), | ||
3624 | + | ||
3625 | +/***/ "./node_modules/@babel/runtime/regenerator/index.js": | ||
3626 | +/*!**********************************************************!*\ | ||
3627 | + !*** ./node_modules/@babel/runtime/regenerator/index.js ***! | ||
3628 | + \**********************************************************/ | ||
3629 | +/*! no static exports found */ | ||
3630 | +/***/ (function(module, exports, __webpack_require__) { | ||
3631 | + | ||
3632 | +eval("module.exports = __webpack_require__(/*! regenerator-runtime */ \"./node_modules/regenerator-runtime/runtime.js\");\n\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/regenerator/index.js?"); | ||
3633 | + | ||
3634 | +/***/ }), | ||
3635 | + | ||
3602 | /***/ "./node_modules/axios/index.js": | 3636 | /***/ "./node_modules/axios/index.js": |
3603 | /*!*************************************!*\ | 3637 | /*!*************************************!*\ |
3604 | !*** ./node_modules/axios/index.js ***! | 3638 | !*** ./node_modules/axios/index.js ***! |
... | @@ -3910,6 +3944,18 @@ eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/ | ... | @@ -3910,6 +3944,18 @@ eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/ |
3910 | 3944 | ||
3911 | /***/ }), | 3945 | /***/ }), |
3912 | 3946 | ||
3947 | +/***/ "./node_modules/get-blob-duration/dist/getBlobDuration.js": | ||
3948 | +/*!****************************************************************!*\ | ||
3949 | + !*** ./node_modules/get-blob-duration/dist/getBlobDuration.js ***! | ||
3950 | + \****************************************************************/ | ||
3951 | +/*! no static exports found */ | ||
3952 | +/***/ (function(module, exports, __webpack_require__) { | ||
3953 | + | ||
3954 | +"use strict"; | ||
3955 | +eval("var _interopRequireDefault=__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ \"./node_modules/@babel/runtime/helpers/interopRequireDefault.js\");Object.defineProperty(exports,\"__esModule\",{value:!0}),exports.default=getBlobDuration;var _regenerator=_interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\")),_asyncToGenerator2=_interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\"));function getBlobDuration(e){return _getBlobDuration.apply(this,arguments)}function _getBlobDuration(){return(_getBlobDuration=(0,_asyncToGenerator2.default)(_regenerator.default.mark(function e(r){var t,n;return _regenerator.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.createElement(\"video\"),n=new Promise(function(e){return t.addEventListener(\"loadedmetadata\",function(){t.duration===1/0?(t.currentTime=Number.MAX_SAFE_INTEGER,t.ontimeupdate=function(){t.ontimeupdate=null,e(t.duration),t.currentTime=0}):e(t.duration)})}),t.src=\"string\"==typeof r||r instanceof String?r:window.URL.createObjectURL(r),e.abrupt(\"return\",n);case 4:case\"end\":return e.stop()}},e)}))).apply(this,arguments)}\n//# sourceMappingURL=getBlobDuration.js.map\n\n\n//# sourceURL=webpack:///./node_modules/get-blob-duration/dist/getBlobDuration.js?"); | ||
3956 | + | ||
3957 | +/***/ }), | ||
3958 | + | ||
3913 | /***/ "./node_modules/process/browser.js": | 3959 | /***/ "./node_modules/process/browser.js": |
3914 | /*!*****************************************!*\ | 3960 | /*!*****************************************!*\ |
3915 | !*** ./node_modules/process/browser.js ***! | 3961 | !*** ./node_modules/process/browser.js ***! | ... | ... |
-
Please register or login to post a comment