@akkadu/agora-rtc-mock
Advanced tools
Comparing version 2.1.0 to 2.2.0-alpha.0
32
index.js
@@ -85,3 +85,3 @@ /* eslint-disable class-methods-use-this */ | ||
*/ | ||
getAllPublisherStreamObjects() { | ||
getResetPublisherStreamObjects() { | ||
const publisherIds = Object.keys(this.publishers) | ||
@@ -137,4 +137,10 @@ const events = [] | ||
unsubscribe(stream) { | ||
unsubscribe(stream, onFailure) { | ||
if (!stream) { | ||
onFailure(new Error('stream has to be defined on unsubscribe')) | ||
} | ||
// if (!stream.stream) { | ||
// onFailure(new Error('stream needs to have a attached mediastream on unsubscribe')) | ||
// } | ||
stream.stream = null | ||
} | ||
@@ -156,2 +162,3 @@ | ||
} | ||
stream.stream = { MediaStream:true } | ||
this.emitter.emit('stream-subscribed', { stream }) | ||
@@ -203,2 +210,5 @@ } | ||
} | ||
/** | ||
* @see https://docs.agora.io/en/Audio%20Broadcast/API%20Reference/web/interfaces/agorartc.stream.html#isplaying | ||
*/ | ||
isPlaying() { | ||
@@ -236,4 +246,12 @@ return this.playing | ||
muteAudio() { | ||
this.playingAudio = false | ||
if (!this.playingAudio && !this.playingVideo) { | ||
this.playing = false | ||
} | ||
} | ||
muteVideo() { | ||
this.playingVideo = false | ||
if (!this.playingAudio && !this.playingVideo) { | ||
this.playing = false | ||
} | ||
} | ||
@@ -247,5 +265,13 @@ hasAudio() { | ||
unmuteAudio() { | ||
this.playingAudio = true | ||
if (this.playingAudio || this.playingVideo) { | ||
this.playing = true | ||
} | ||
} | ||
unmuteVideo() { | ||
this.playingVideo = true | ||
if (this.playingAudio || this.playingVideo) { | ||
this.playing = true | ||
} | ||
} | ||
@@ -252,0 +278,0 @@ |
{ | ||
"name": "@akkadu/agora-rtc-mock", | ||
"version": "2.1.0", | ||
"version": "2.2.0-alpha.0", | ||
"module": "dist/index.js", | ||
@@ -29,3 +29,3 @@ "license": "ISC", | ||
"description": "", | ||
"gitHead": "a837028182a5bfc69edbcff68a119a24a09ba984" | ||
"gitHead": "53ae3e1baf4a73c3de6d1f7b46a282568f321b67" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
37282
549
2