How to use the react-native-music-control.updatePlayback 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).not.toHaveBeenCalled();
    });
});
github flarocca / react-native-music-player-service / __tests__ / src / MusicPlayerService.Tests.js View on Github external
beforeEach(() => {
  Sound.mockReset();
  Sound.prototype.play.mockClear();
  Sound.prototype.pause.mockClear();
  Sound.prototype.stop.mockClear();
  Sound.prototype.release.mockClear();

  MusicControl.on.mockClear();
  MusicControl.enableControl.mockClear();
  MusicControl.enableBackgroundMode.mockClear();
  MusicControl.setNowPlaying.mockClear();
  MusicControl.updatePlayback.mockClear();
});
github sonnylazuardi / bibleify-mobile / old / src / screens / Passage / PassageScreen.js View on Github external
() => {
        if (this.state.paused) {
          MusicControl.updatePlayback({
            state: MusicControl.STATE_PAUSED
          });
        } else {
          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
      })
    }
  }
github var77 / react-native-youtube-player / src / containers / MiniPlayer.js View on Github external
return this.toggleShuffle(true, true);
     }

   if(this.props.songs.length == 1) return;

    if(this.props.songIndex + 1 != this.props.songs.length) {
      let index = this.props.songIndex + 1;
      let song = this.props.songs[index];
      let changePath = (!song.downloaded && !song.pathChanged);
      return this.props.setPlayingSong(index, changePath? this.props.songs: null, changePath);
    }
    let song = this.props.songs[0];
    let changePath = (!song.downloaded && !song.pathChanged);
    this.props.setPlayingSong(0, changePath? this.props.songs: null, changePath);
    this.props.setPlaying(false);
    MusicControl.updatePlayback({
      title: song.title,
      artwork: song.thumb,
      artist: song.artist,
      state: MusicControl.STATE_PAUSED,
      elapsedTime: 0
    });
  }
github var77 / react-native-youtube-player / src / containers / MiniPlayer.js View on Github external
togglePlay(status) {
    this.props.setPlaying(status);
    MusicControl.updatePlayback({
      state: status? MusicControl.STATE_PLAYING: MusicControl.STATE_PAUSED,
      elapsedTime: this.state.currentTime
    })
  }