code: public static MediaPlayer createMediaPlayer(String filenameOrURL) {
          // create mediaplayer instance
          MediaPlayer mediaPlayer = new MediaPlayer();
          try {
              mediaPlayer.setDataSource(filenameOrURL);
              mediaPlayer.prepare();
          } catch (IOException e) {
              e.printStackTrace();
              return null;
          }
  
          return mediaPlayer;
      }
docs: Creates a {@code MediaPlayer} with a specified data source. The returned media player
  is not started.
  
  @param filenameOrURL
  A string representing a path of the data file, or a URL.
  
  @return The {@code MediaPlayer} object if successful, or {@code null} if there is
  an error.