Code example for MediaPlayer

Methods: getCurrentPositiongetDurationisLoopingisPlaying

    result.put("tag", getDefault(tag));
    if (player == null) {
      result.put("loaded", false);
    } else { 
      result.put("loaded", true);
      result.put("duration", player.getDuration());
      result.put("position", player.getCurrentPosition());
      result.put("isplaying", player.isPlaying());
      result.put("url", getUrl(tag));
      result.put("looping", player.isLooping());
    return result;
  @Rpc(description = "Lists currently loaded media", returns = "List of Media Tags") 
  public Set<String> mediaPlayList() {
    return mPlayers.keySet();
  @Rpc(description = "Set Looping", returns = "True if successful") 
Experience pair programming with AI  Get Codota for Java