@twilio/audioplayer
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -197,12 +197,9 @@ "use strict"; | ||
if (!this._audioElement.srcObject) { | ||
_context.next = 20; | ||
_context.next = 19; | ||
break; | ||
} | ||
this.addEventListener('ended', function () { | ||
_this2._audioElement.srcObject = null; | ||
}); | ||
return _context.abrupt("return", this._audioElement.play()); | ||
case 20: | ||
case 19: | ||
case "end": | ||
@@ -427,3 +424,15 @@ return _context.stop(); | ||
} | ||
/** | ||
* The srcObject of the HTMLMediaElement | ||
*/ | ||
}, { | ||
key: "srcObject", | ||
get: function get() { | ||
return this._audioElement.srcObject; | ||
}, | ||
set: function set(srcObject) { | ||
this._audioElement.srcObject = srcObject; | ||
} | ||
}, { | ||
key: "sinkId", | ||
@@ -430,0 +439,0 @@ get: function get() { |
@@ -85,2 +85,6 @@ import EventTarget from './EventTarget'; | ||
/** | ||
* The srcObject of the HTMLMediaElement | ||
*/ | ||
srcObject: MediaStream | MediaSource | Blob | undefined; | ||
/** | ||
* The current sinkId of the device audio is being played through. | ||
@@ -87,0 +91,0 @@ */ |
@@ -96,2 +96,11 @@ "use strict"; | ||
} | ||
/** | ||
* The srcObject of the HTMLMediaElement | ||
*/ | ||
get srcObject() { | ||
return this._audioElement.srcObject; | ||
} | ||
set srcObject(srcObject) { | ||
this._audioElement.srcObject = srcObject; | ||
} | ||
get sinkId() { return this._sinkId; } | ||
@@ -148,5 +157,2 @@ /** | ||
if (this._audioElement.srcObject) { | ||
this.addEventListener('ended', () => { | ||
this._audioElement.srcObject = null; | ||
}); | ||
return this._audioElement.play(); | ||
@@ -153,0 +159,0 @@ } |
{ | ||
"name": "@twilio/audioplayer", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "An HTMLAudioElement-like implementation that uses AudioContext to circumvent browser limitations.", | ||
@@ -5,0 +5,0 @@ "main": "./es5/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84556
1853