Skip to content

Commit

Permalink
use srcObject in setSinkId (katspaugh#1429)
Browse files Browse the repository at this point in the history
* use srcObject in setSinkId to replace deprecated API

* update changelog
  • Loading branch information
thijstriemstra committed Aug 19, 2018
1 parent a497c33 commit e99d724
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
wavesurfer.js changelog
=======================

2.0.7 (unreleased)
------------------

- Add wavesurfer.js logo, created by @entonbiba (#1409)
- Fix `setSinkId` that used deprecated API (#1428)
- Set `isReady` attribute to false when emptying wavesufer (#1396, #1403)

2.0.6 (14.06.2018)
------------------

Expand Down
4 changes: 2 additions & 2 deletions src/webaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export default class WebAudio extends util.Observer {
setSinkId(deviceId) {
if (deviceId) {
/**
* The webaudio api doesn't currently support setting the device
* The webaudio API doesn't currently support setting the device
* output. Here we create an HTMLAudioElement, connect the
* webaudio stream to that element and setSinkId there.
*/
Expand All @@ -300,7 +300,7 @@ export default class WebAudio extends util.Observer {
var dest = this.ac.createMediaStreamDestination();
this.gainNode.disconnect();
this.gainNode.connect(dest);
audio.src = URL.createObjectURL(dest.stream);
audio.srcObject = dest.stream;

return audio.setSinkId(deviceId);
} else {
Expand Down

0 comments on commit e99d724

Please sign in to comment.