Skip to content

Commit

Permalink
vmsg plugin: add destroy (#331)
Browse files Browse the repository at this point in the history
* vmsg plugin: add destroy

* add changelog entry
  • Loading branch information
thijstriemstra committed Feb 10, 2019
1 parent aadf9e1 commit 3de605c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
10 changes: 8 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
videojs-record changelog
========================

3.4.2 - unreleased
------------------

- vmsg plugin: add `destroy`


3.4.1 - 2019/02/09
------------------

Expand All @@ -15,8 +21,8 @@ videojs-record changelog
- Support video recording in Safari (Technology Preview 73 or newer) (#181)
- Bump required version for recordrtc to 5.5.3 for Safari video recording
support (#320)
- Added example for changing video source (#223)
- Added ability to permanently hide custom UI elements (e.g. `recordToggle`)
- Add example for changing video source (#223)
- Add ability to permanently hide custom UI elements (e.g. `recordToggle`)


3.3.0 - 2019/01/10
Expand Down
5 changes: 5 additions & 0 deletions src/js/engine/record-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ class RecordEngine extends Component {
}
}

/**
* Destroy engine.
*/
destroy() {}

/**
* Add filename and timestamp to recorded file object.
*
Expand Down
10 changes: 8 additions & 2 deletions src/js/engine/record-rtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ class RecordRTCEngine extends RecordEngine {
dispose() {
super.dispose();

if (typeof this.engine.destroy === 'function') {
this.destroy();
}

/**
* Destroy engine.
*/
destroy() {
if (this.engine && typeof this.engine.destroy === 'function') {
this.engine.destroy();
}
}
Expand Down Expand Up @@ -163,7 +170,6 @@ class RecordRTCEngine extends RecordEngine {

// notify listeners
this.trigger('recordComplete');

});
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/js/plugins/vmsg-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ class VmsgEngine extends RecordEngine {
}
}

/**
* Destroy engine.
*/
destroy() {
if (this.engine && typeof this.engine.close === 'function') {
this.engine.close();
}
}

/**
* Continuous encoding of audio data.
* @private
Expand Down
1 change: 1 addition & 0 deletions src/js/videojs.record.js
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ class Record extends Plugin {
// prevent callbacks if recording is in progress
if (this.engine) {
this.engine.dispose();
this.engine.destroy();
this.engine.off('recordComplete', this.engineStopCallback);
}

Expand Down

0 comments on commit 3de605c

Please sign in to comment.