MCPcopy Create free account
hub / github.com/zmxv/react-native-sound / registerOnPlay

Method registerOnPlay

src/index.ts:121–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119 }
120
121 private registerOnPlay() {
122 if (this.onPlaySubscription) {
123 return;
124 }
125
126 if (!IsWindows) {
127 this.onPlaySubscription = eventEmitter.addListener(
128 "onPlayChange",
129 (param: { isPlaying: boolean; playerKey: number }) => {
130 const { isPlaying, playerKey } = param;
131 if (playerKey === this._key) {
132 this._playing = isPlaying;
133 }
134 }
135 );
136 }
137 }
138
139 private calculateRelativeVolume(volume: number, pan: number): number {
140 const relativeVolume = volume * (1 - Math.abs(pan));

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected