videomail-client 3.0.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TODO.md +4 -4
- package/package.json +9 -9
- package/prototype/js/videomail-client.js +432 -442
- package/prototype/js/videomail-client.min.js +10 -10
- package/prototype/js/videomail-client.min.js.map +1 -1
- package/src/js/util/browser.js +20 -59
- package/src/js/wrappers/visuals/recorder.js +2 -0
- package/src/js/wrappers/visuals/replay.js +8 -9
package/src/js/util/browser.js
CHANGED
|
@@ -10,7 +10,6 @@ const Browser = function (options) {
|
|
|
10
10
|
const edgeDownload = 'https://www.microsoft.com/en-us/download/details.aspx?id=48126'
|
|
11
11
|
const chromeDownload = 'http://www.google.com/chrome/'
|
|
12
12
|
const chromiumDownload = 'http://www.chromium.org/getting-involved/download-chromium'
|
|
13
|
-
const browseHappyLink = 'http://browsehappy.com'
|
|
14
13
|
const ua = defined(
|
|
15
14
|
options.fakeUaString,
|
|
16
15
|
typeof window !== 'undefined' && window.navigator && window.navigator.userAgent,
|
|
@@ -148,35 +147,6 @@ const Browser = function (options) {
|
|
|
148
147
|
return warning
|
|
149
148
|
}
|
|
150
149
|
|
|
151
|
-
function getPlaybackWarning() {
|
|
152
|
-
let warning = getRecommendation()
|
|
153
|
-
|
|
154
|
-
if (!warning) {
|
|
155
|
-
warning =
|
|
156
|
-
'<a href="' +
|
|
157
|
-
browseHappyLink +
|
|
158
|
-
'" target="_blank">Upgrading your browser</a> might help.'
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return warning
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function canPlayType(video, type) {
|
|
165
|
-
let canPlayType
|
|
166
|
-
|
|
167
|
-
if (video && video.canPlayType) {
|
|
168
|
-
canPlayType = video.canPlayType('video/' + type)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// definitely cannot be played here
|
|
172
|
-
if (canPlayType === '') {
|
|
173
|
-
return false
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return canPlayType
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// just temporary
|
|
180
150
|
this.canRecord = function () {
|
|
181
151
|
const hasNavigator = typeof navigator !== 'undefined'
|
|
182
152
|
let canRecord = false
|
|
@@ -257,28 +227,6 @@ const Browser = function (options) {
|
|
|
257
227
|
return err
|
|
258
228
|
}
|
|
259
229
|
|
|
260
|
-
this.checkPlaybackCapabilities = function (video) {
|
|
261
|
-
options.debug('Browser: checkPlaybackCapabilities()')
|
|
262
|
-
|
|
263
|
-
let err
|
|
264
|
-
let message
|
|
265
|
-
|
|
266
|
-
if (!video) {
|
|
267
|
-
message = 'No HTML5 support for video tag!'
|
|
268
|
-
} else if (!this.getVideoType(video)) {
|
|
269
|
-
message = 'Your old browser cannot support modern video codecs'
|
|
270
|
-
} else if (!video.setAttribute) {
|
|
271
|
-
// fixes "Not implemented" error on older browsers
|
|
272
|
-
message = 'Unable to set video attributes in your old browser'
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (message) {
|
|
276
|
-
err = VideomailError.create(message, getPlaybackWarning(), options)
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return err
|
|
280
|
-
}
|
|
281
|
-
|
|
282
230
|
this.checkBufferTypes = function () {
|
|
283
231
|
let err
|
|
284
232
|
|
|
@@ -293,6 +241,21 @@ const Browser = function (options) {
|
|
|
293
241
|
return err
|
|
294
242
|
}
|
|
295
243
|
|
|
244
|
+
function canPlayType(video, type) {
|
|
245
|
+
let canPlayType
|
|
246
|
+
|
|
247
|
+
if (video && video.canPlayType) {
|
|
248
|
+
canPlayType = video.canPlayType('video/' + type)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// definitely cannot be played here
|
|
252
|
+
if (canPlayType === '') {
|
|
253
|
+
return false
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return canPlayType
|
|
257
|
+
}
|
|
258
|
+
|
|
296
259
|
this.getVideoType = function (video) {
|
|
297
260
|
if (!video) {
|
|
298
261
|
// no type without video
|
|
@@ -300,18 +263,16 @@ const Browser = function (options) {
|
|
|
300
263
|
}
|
|
301
264
|
|
|
302
265
|
if (!videoType) {
|
|
303
|
-
|
|
304
|
-
if (canPlayType(video, 'mp4') && !chromeBased) {
|
|
305
|
-
videoType = 'mp4'
|
|
306
|
-
} else if (canPlayType(video, 'webm')) {
|
|
266
|
+
if (canPlayType(video, 'webm')) {
|
|
307
267
|
videoType = 'webm'
|
|
268
|
+
} else if (canPlayType(video, 'mp4')) {
|
|
269
|
+
videoType = 'mp4'
|
|
308
270
|
}
|
|
309
271
|
}
|
|
310
272
|
|
|
311
273
|
if (!videoType || videoType === '') {
|
|
312
|
-
//
|
|
313
|
-
|
|
314
|
-
videoType = 'mp4'
|
|
274
|
+
// just as a fallback
|
|
275
|
+
videoType = 'webm'
|
|
315
276
|
}
|
|
316
277
|
|
|
317
278
|
return videoType
|
|
@@ -237,6 +237,8 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
|
|
|
237
237
|
|
|
238
238
|
key = args.key
|
|
239
239
|
|
|
240
|
+
// We are not serving MP4 videos anymore due to licensing but are keeping code
|
|
241
|
+
// for compatibility and documentation
|
|
240
242
|
if (args.mp4) {
|
|
241
243
|
replay.setMp4Source(
|
|
242
244
|
args.mp4 + Constants.SITE_NAME_LABEL + '/' + options.siteName + '/videomail.mp4',
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import util from 'util'
|
|
2
|
-
import h from 'hyperscript'
|
|
3
|
-
import hidden from 'hidden'
|
|
4
1
|
import addEventListenerWithOptions from 'add-eventlistener-with-options'
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import Browser from './../../util/browser'
|
|
8
|
-
import EventEmitter from './../../util/eventEmitter'
|
|
9
|
-
import VideomailError from './../../util/videomailError'
|
|
10
|
-
|
|
2
|
+
import hidden from 'hidden'
|
|
3
|
+
import h from 'hyperscript'
|
|
11
4
|
import enableInlineVideo from 'iphone-inline-video'
|
|
5
|
+
import util from 'util'
|
|
6
|
+
|
|
7
|
+
import Events from '../../events'
|
|
8
|
+
import Browser from '../../util/browser'
|
|
9
|
+
import EventEmitter from '../../util/eventEmitter'
|
|
10
|
+
import VideomailError from '../../util/videomailError'
|
|
12
11
|
|
|
13
12
|
const Replay = function (parentElement, options) {
|
|
14
13
|
EventEmitter.call(this, options, 'Replay')
|