videojs-record
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "videojs-record", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/collab-project/videojs-record", | ||
@@ -5,0 +5,0 @@ "description": "A video.js plugin for recording audio/video/image files.", |
{ | ||
"name": "videojs-record", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A video.js plugin for recording audio/video/image files.", | ||
@@ -5,0 +5,0 @@ "main": "src/js/videojs.record.js", |
@@ -344,7 +344,7 @@ (function (root, factory) | ||
{ | ||
this.player().controlBar.remainingTimeDisplay.dispose(); | ||
this.player().controlBar.remainingTimeDisplay.el().style.display = 'none'; | ||
} | ||
if (this.player().controlBar.liveDisplay !== undefined) | ||
{ | ||
this.player().controlBar.liveDisplay.dispose(); | ||
this.player().controlBar.liveDisplay.el().style.display = 'none'; | ||
} | ||
@@ -358,6 +358,8 @@ | ||
this.surfer = this.player().waveform; | ||
// initially hide playhead (fixed in wavesurfer 1.0.25) | ||
this.playhead = this.surfer.el().getElementsByTagName('wave')[1]; | ||
this.playhead.style.display = 'none'; | ||
if (this.surfer) | ||
{ | ||
// initially hide playhead (fixed in wavesurfer 1.0.25) | ||
this.playhead = this.surfer.el().getElementsByTagName('wave')[1]; | ||
this.playhead.style.display = 'none'; | ||
} | ||
break; | ||
@@ -420,2 +422,10 @@ | ||
/** | ||
* Indicates whether the player is destroyed or not. | ||
*/ | ||
isDestroyed: function() | ||
{ | ||
return this.player() && (this.player().children() === null); | ||
}, | ||
/** | ||
* Open the brower's recording device selection dialog. | ||
@@ -430,3 +440,2 @@ */ | ||
} | ||
if (this.deviceErrorCallback === undefined) | ||
@@ -436,2 +445,6 @@ { | ||
} | ||
if (this.engineStopCallback === undefined) | ||
{ | ||
this.engineStopCallback = this.onRecordComplete.bind(this); | ||
} | ||
// ask the browser to give us access to media device and get a | ||
@@ -566,4 +579,3 @@ // stream reference in the callback function | ||
// listen for events | ||
this.engine.on('recordComplete', | ||
this.onRecordComplete.bind(this)); | ||
this.engine.on('recordComplete', this.engineStopCallback); | ||
@@ -739,8 +751,14 @@ // audio settings | ||
// stop recording stream (result will be available async) | ||
this.engine.stop(); | ||
if (this.engine) | ||
{ | ||
this.engine.stop(); | ||
} | ||
} | ||
else | ||
{ | ||
// notify listeners that image data is (already) available | ||
this.player().trigger('finishRecord'); | ||
if (this.player().recordedData) | ||
{ | ||
// notify listeners that image data is (already) available | ||
this.player().trigger('finishRecord'); | ||
} | ||
} | ||
@@ -759,3 +777,3 @@ } | ||
// otherwise it'll break recording | ||
this.player().one('finishRecord', this.stopStream); | ||
this.player().one('finishRecord', this.stopStream.bind(this)); | ||
@@ -1124,7 +1142,12 @@ // stop recording | ||
{ | ||
// stop playback | ||
this._recording = false; | ||
this._processing = false; | ||
this._deviceActive = false; | ||
// prevent callbacks if recording is in progress | ||
if (this.engine) | ||
{ | ||
this.engine.off('recordComplete', this.engineStopCallback); | ||
} | ||
// stop recording and device | ||
this.stop(); | ||
this.stopDevice(); | ||
// stop countdown | ||
@@ -1137,4 +1160,7 @@ this.clearInterval(this.countDown); | ||
case this.AUDIO_ONLY: | ||
// also disposes player | ||
this.surfer.destroy(); | ||
if (this.surfer) | ||
{ | ||
// also disposes player | ||
this.surfer.destroy(); | ||
} | ||
break; | ||
@@ -1149,2 +1175,6 @@ | ||
} | ||
this._recording = false; | ||
this._processing = false; | ||
this._deviceActive = false; | ||
}, | ||
@@ -1151,0 +1181,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
722883
2056