How to use the react-native-music-control.STATE_PLAYING function in react-native-music-control

To help you get started, we’ve selected a few react-native-music-control examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flarocca / react-native-music-player-service / __tests__ / src / MusicPlayerService.Tests.js View on Github external
.then(() => {
      expect(MusicControl.updatePlayback).toHaveBeenCalledTimes(1);
      expect(MusicControl.updatePlayback).toHaveBeenCalledWith({ state: MusicControl.STATE_PLAYING, elapsedTime });
    });
});
github flarocca / react-native-music-player-service / src / MusicPlayerService.js View on Github external
return promise.then(() => {
      if (this._trackPlaying) {
        this._trackPlaying.play(success => {
          this.playNext();
        });

        this.isPlaying = true;

        if (this.enableSetNowPlaying) {
          this._updatePlayback(MusicControl.STATE_PLAYING);
        }

        if (this._onPlay) {
          this._onPlay(track);
        }

        return Promise.resolve();
      } else {
        return Promise.reject();
      }
    });
  }
github sonnylazuardi / bibleify-mobile / old / src / screens / Passage / PassageScreen.js View on Github external
() => {
        MusicControl.updatePlayback({
          state: MusicControl.STATE_PLAYING,
          elapsedTime: currentTime
        });
      }
    );
github sonnylazuardi / bibleify-mobile / old / src / screens / Passage / PassageScreen.js View on Github external
artist: "Alkitab Suara",
          duration: this.state.streamDuration,
          color: 0xfffffff
        });

        MusicControl.on("play", () => {
          this.setState({ paused: false });
        });
        MusicControl.on("pause", () => {
          this.setState({ paused: true });
        });
        MusicControl.on("nextTrack", () => {});
        MusicControl.on("previousTrack", () => {});

        MusicControl.updatePlayback({
          state: MusicControl.STATE_PLAYING
        });
      }
    );
github var77 / react-native-youtube-player / src / containers / MiniPlayer.js View on Github external
goBackward(){
    if(this.state.currentTime < 3 && this.props.songIndex !== 0 ) {
      this.props.setPlayingSong(this.props.songIndex - 1);
    } else {
      this.refs.audio.seek(0);
      MusicControl.updatePlayback({
        state: MusicControl.STATE_PLAYING,
        elapsedTime: 0
      })
    }
  }