Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@twilio/audioplayer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilio/audioplayer - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

7

es5/AudioPlayer.js

@@ -197,9 +197,12 @@ "use strict";

if (!this._audioElement.srcObject) {
_context.next = 19;
_context.next = 20;
break;
}
this.addEventListener('ended', function () {
_this2._audioElement.srcObject = null;
});
return _context.abrupt("return", this._audioElement.play());
case 19:
case 20:
case "end":

@@ -206,0 +209,0 @@ return _context.stop();

@@ -147,2 +147,5 @@ "use strict";

if (this._audioElement.srcObject) {
this.addEventListener('ended', () => {
this._audioElement.srcObject = null;
});
return this._audioElement.play();

@@ -149,0 +152,0 @@ }

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { EventEmitter } from 'events';

@@ -3,0 +2,0 @@ export default class EventTarget {

{
"name": "@twilio/audioplayer",
"version": "1.0.3",
"version": "1.0.4",
"description": "An HTMLAudioElement-like implementation that uses AudioContext to circumvent browser limitations.",

@@ -5,0 +5,0 @@ "main": "./es5/index.js",

@@ -227,2 +227,5 @@ import Deferred from './Deferred';

if (this._audioElement.srcObject) {
this.addEventListener('ended', () => {
this._audioElement.srcObject = null;
});
return this._audioElement.play();

@@ -254,3 +257,2 @@ }

this._sinkId = sinkId;
return;

@@ -257,0 +259,0 @@ }

@@ -168,2 +168,12 @@ /* tslint:disable:max-classes-per-file no-empty */

it('should clear srcObject if a sinkId is set', () => {
audioPlayer.setSinkId('foo');
return audioPlayer.play().then(() => {
audioContext.audioNodes[0].dispatchEvent('ended');
assert.equal(AudioFactory.instances.length, 1);
assert.equal(AudioFactory.instances[0].srcObject, null);
});
});
context('when already playing', () => {

@@ -523,2 +533,4 @@ it('should not create another audio node', () => {

srcObject: any;
constructor() {

@@ -525,0 +537,0 @@ this.play = sinon.spy(this.play);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc