|
10502 | 10502 | "use strict"; |
10503 | 10503 | __webpack_require__.r(__webpack_exports__); |
10504 | 10504 | __webpack_require__.d(__webpack_exports__, { |
10505 | | - VideomailClient: ()=>src_client, |
| 10505 | + VideomailClient: ()=>VideomailClient, |
10506 | 10506 | VideoType: ()=>VideoType |
10507 | 10507 | }); |
| 10508 | + const VideoType = { |
| 10509 | + WebM: "webm", |
| 10510 | + MP4: "mp4" |
| 10511 | + }; |
10508 | 10512 | const constants = { |
10509 | 10513 | SITE_NAME_LABEL: "x-videomail-site-name", |
10510 | 10514 | VERSION_LABEL: "videomailClientVersion", |
|
10666 | 10670 | var client = __webpack_require__("./node_modules/superagent/lib/client.js"); |
10667 | 10671 | var client_default = /*#__PURE__*/ __webpack_require__.n(client); |
10668 | 10672 | var package_namespaceObject = { |
10669 | | - rE: "11.5.2" |
| 10673 | + rE: "13.0.0" |
10670 | 10674 | }; |
10671 | 10675 | var defined = __webpack_require__("./node_modules/defined/index.js"); |
10672 | 10676 | var defined_default = /*#__PURE__*/ __webpack_require__.n(defined); |
|
13826 | 13830 | NAME, |
13827 | 13831 | VERSION |
13828 | 13832 | ]); |
13829 | | - const VideoType = { |
13830 | | - WebM: "webm", |
13831 | | - MP4: "mp4" |
13832 | | - }; |
13833 | 13833 | function canPlayType_canPlayType(video, type) { |
13834 | 13834 | const canPlayType = video.canPlayType(`video/${type}`); |
13835 | 13835 | if ("" === canPlayType) return false; |
|
13879 | 13879 | isOkSafari() { |
13880 | 13880 | const version = this.getBrowserVersion(); |
13881 | 13881 | if (!version) return false; |
13882 | | - return this.isSafari() && parseFloat(version) >= 11; |
| 13882 | + return this.isSafari() && Number.parseFloat(version) >= 11; |
13883 | 13883 | } |
13884 | 13884 | getVideoType(video) { |
13885 | 13885 | if (!this.videoType) { |
|
14553 | 14553 | this.options.logger.debug(`Form: doTheSubmit(${util_pretty(e)})`); |
14554 | 14554 | e.preventDefault(); |
14555 | 14555 | } else this.options.logger.debug("Form: doTheSubmit()"); |
14556 | | - const url = this.formElement.getAttribute("action") ?? this.options.baseUrl; |
| 14556 | + const url = this.formElement.getAttribute("action") ?? this.options.apiUrl; |
14557 | 14557 | const method = this.formElement.getAttribute("method"); |
14558 | 14558 | let chosenMethod; |
14559 | 14559 | switch(method){ |
|
14632 | 14632 | return newVideomail; |
14633 | 14633 | } |
14634 | 14634 | async get(identifierName, identifierValue) { |
14635 | | - const url = `${this.options.baseUrl}/videomail/${identifierName}/${identifierValue}/snapshot`; |
| 14635 | + const url = `${this.options.apiUrl}/videomail/${identifierName}/${identifierValue}/snapshot`; |
14636 | 14636 | try { |
14637 | 14637 | const request = await client_default()("get", url).type("json").set("Accept", "application/json").withCredentials().set("Timezone-Id", this.timezoneId).set(constants.SITE_NAME_LABEL, this.options.siteName).timeout(this.options.timeouts.connection); |
14638 | 14638 | const videomail = request.body; |
|
14648 | 14648 | const queryParams = { |
14649 | 14649 | [constants.SITE_NAME_LABEL]: this.options.siteName |
14650 | 14650 | }; |
14651 | | - let url = `${this.options.baseUrl}/videomail/`; |
| 14651 | + let url = `${this.options.apiUrl}/videomail/`; |
14652 | 14652 | if (method === FormMethod.PUT && videomail.key) url += videomail.key; |
14653 | 14653 | try { |
14654 | 14654 | const request = await client_default()(method, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(videomail).timeout(this.options.timeouts.connection); |
|
14670 | 14670 | const queryParams = { |
14671 | 14671 | [constants.SITE_NAME_LABEL]: this.options.siteName |
14672 | 14672 | }; |
14673 | | - const url = `${this.options.baseUrl}/client-error/`; |
| 14673 | + const url = `${this.options.apiUrl}/client-error/`; |
14674 | 14674 | try { |
14675 | 14675 | const fullVideomailErrorData = { |
14676 | 14676 | browser: err.browser, |
|
14767 | 14767 | logger: console, |
14768 | 14768 | logStackSize: 30, |
14769 | 14769 | verbose: !PRODUCTION, |
14770 | | - baseUrl: "https://videomail.io", |
| 14770 | + apiUrl: "https://videomail.io/api", |
14771 | 14771 | socketUrl: "wss://videomail.io", |
14772 | 14772 | siteName: "videomail-client-demo", |
14773 | 14773 | enablePause: true, |
|
15449 | 15449 | } |
15450 | 15450 | start(cb) { |
15451 | 15451 | if (!this.countdownElement) throw new Error("Unable to start countdown without an element"); |
15452 | | - if ("number" != typeof this.options.video.countdown) throw new Error(`The defined countdown is not a valid number: ${this.options.video.countdown}`); |
| 15452 | + if ("number" != typeof this.options.video.countdown) throw new TypeError(`The defined countdown is not a valid number: ${this.options.video.countdown}`); |
15453 | 15453 | this.countdown = this.options.video.countdown; |
15454 | 15454 | this.countdownElement.innerHTML = this.countdown.toString(); |
15455 | 15455 | this.show(); |
|
17704 | 17704 | const tracks = this.replayElement.getElementsByTagName("track"); |
17705 | 17705 | const firstTrack = tracks[0]; |
17706 | 17706 | if (firstTrack) if (src) firstTrack.setAttribute("src", src); |
17707 | | - else this.replayElement.removeChild(firstTrack); |
| 17707 | + else firstTrack.remove(); |
17708 | 17708 | else { |
17709 | 17709 | const track = document.createElement("track"); |
17710 | 17710 | track.setAttribute("src", src); |
|
17721 | 17721 | let url = src; |
17722 | 17722 | if (url && bustCache) url += `?${Date.now()}`; |
17723 | 17723 | if (source) if (src) source.setAttribute("src", src); |
17724 | | - else this.replayElement.removeChild(source); |
| 17724 | + else source.remove(); |
17725 | 17725 | else if (src) { |
17726 | 17726 | const { fps } = this.options.video; |
17727 | 17727 | const t = 1 / fps * 2; |
|
18629 | 18629 | if (this.options.logger.getLines) return this.options.logger.getLines(); |
18630 | 18630 | } |
18631 | 18631 | } |
18632 | | - const src_client = VideomailClient; |
18633 | 18632 | })(); |
18634 | 18633 | return __webpack_exports__; |
18635 | 18634 | })()); |
0 commit comments