mediaevents
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -70,2 +70,71 @@ /* mediaEvents | ||
set muted (muted) { | ||
this._muted = muted | ||
} | ||
get muted () { | ||
return this._muted | ||
} | ||
set volume (db) { | ||
this._volume = db | ||
this.clampGain() | ||
if (!this.muted) { | ||
this.gainNode.gain.value = this.dbToVolume(this._volume) | ||
} | ||
} | ||
get volume () { | ||
return this._volume | ||
} | ||
set paused (paused) { | ||
this._paused = paused; | ||
} | ||
get paused () { | ||
return this._paused; | ||
} | ||
clampGain () { | ||
if (this._volume < -80) { | ||
this._volume = -80 | ||
} else if (this._volume > 5) { | ||
this._volume = 5 | ||
} | ||
} | ||
dbToVolume (db) { | ||
return Math.pow(10, db / 20) | ||
} | ||
mute() { | ||
if (!this.muted) { | ||
this.muted = true | ||
this.gainNode.gain.value = 0 | ||
} | ||
} | ||
unmute() { | ||
if (this.muted) { | ||
this.muted = false | ||
this.gainNode.gain.value = this.dbToVolume(this._volume) | ||
} | ||
} | ||
pause () { | ||
if (!this.paused) { | ||
this.audioContext.suspend(); | ||
this.paused = true; | ||
} | ||
} | ||
unpause () { | ||
if (this.paused) { | ||
this.audioContext.resume(); | ||
this.paused = false; | ||
} | ||
} | ||
getActiveTimingKey (currentTime) { | ||
@@ -72,0 +141,0 @@ const timingKeys = Object.keys(this.timings) |
{ | ||
"name": "mediaevents", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Fire events for specific timeframes easily", | ||
@@ -5,0 +5,0 @@ "main": "mediaevents.js", |
@@ -15,3 +15,3 @@ # mediaEvents | ||
```html | ||
<script src="https://unpkg.com/mediaevents@3.0.0/mediaevents.js"></script> | ||
<script src="https://unpkg.com/mediaevents@3.1.0/mediaevents.js"></script> | ||
``` | ||
@@ -18,0 +18,0 @@ |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
7501
165
1