Create a new MediaPlayer instance.

        @param uri: an optional URI to play in the player.
773984
def media_player_new(self, uri=None):
        
        p = libvlc_media_player_new(self)
        if uri:
            p.set_media(self.media_new(uri))
        p._instance = self
        return p
892458
public static Observable<File> createFileFromUri(final Context context, final Uri data) {
    return createFileFromUri(context, data, MimeMap.UrlConnection);
  }
1006223
@VisibleForTesting
  static URI sourceURI(URI uri) {
    if (!uri.getScheme().equals("jar")) {
      return uri;
    }
    try {
      return URI.create(
          "file:/" + ((JarURLConnection) uri.toURL().openConnection()).getEntryName());
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
1206478
public static Intent newPlayMediaIntent(String url, String type) {
        return newPlayMediaIntent(Uri.parse(url), type);
    }
1012816
public function create($uri)
    {
        list($scheme, $host, $port, $path, $query, $fragment, $user, $pass) = $this->parseUrl($uri);

        return new Uri($scheme, $host, $port, $path, $query, $fragment, $user, $pass);
    }
493597
public function toUri(): UriInterface
    {
        $str = $this::BASE_URL.$this->account->getPid().'/'.$this->player->getPid();

        if ($this->embed) {
            $str .= '/embed';
        }

        if ($this->byGuid) {
            $ownerId = $this->media->getOwnerId();
            $parts = explode('/', $ownerId);
            $numeric_id = end($parts);

            $uri = new Uri($str.'/select/media/guid/'.$numeric_id.'/'.$this->media->getGuid());
        } else {
            $uri = new Uri($str.'/select/media/'.$this->media->getPid());
        }

        $query_parts = [];

        // We use isset() so that if the values have never been explicitly set
        // the player configuration is used instead.
        if (isset($this->autoPlay)) {
            $query_parts['autoPlay'] = $this->autoPlay ? 'true' : 'false';
        }

        if (isset($this->playAll)) {
            $query_parts['playAll'] = $this->playAll ? 'true' : 'false';
        }

        $uri = $uri->withQuery(build_query($query_parts));

        return $uri;
    }
611446
protected final void initializeMediaDownload() {
    HttpRequestFactory requestFactory = abstractGoogleClient.getRequestFactory();
    this.downloader =
        new MediaHttpDownloader(requestFactory.getTransport(), requestFactory.getInitializer());
  }
544198
public void setURI(URI uri) throws URIException {

        if (uri.getScheme() == null || uri.getScheme().equals("")) {
            mUri = new URI(HTTP + "://" + getHeader(HOST) + "/" + mUri.toString(), true);
            
        } else {
            mUri = uri;
        }

        if (uri.getScheme().equalsIgnoreCase(HTTPS)) {
            mIsSecure = true;
            
        } else {
            mIsSecure = false;
        }

        setHostPort(mUri.getPort());
    }
160970
public static Intent newPlayMediaFileIntent(String path, String type) {
        return newPlayMediaIntent(Uri.fromFile(new File(path)), type);
    }
665860
public static Observable<List<File>> createFileFromUri(final Context context,
      final ArrayList<Uri> uris) {
    return createFileFromUri(context, uris, MimeMap.UrlConnection);
  }
308528
public static function createFromString($uri)
    {
        if (!is_string($uri) && !method_exists($uri, '__toString')) {
            throw new InvalidArgumentException('Uri must be a string');
        }

        return self::createFromParse(parse_url($uri));
    }
741004
public static WebsocketClientTransport create(URI uri) {
    Objects.requireNonNull(uri, "uri must not be null");

    TcpClient client = createClient(uri);
    return create(HttpClient.from(client), uri.getPath());
  }
811472
public ConnectionOptions withUri(URI uri)
    throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException
  {
     factory.setUri(Assert.notNull(uri, "URI"));
     return this;
  }
681132
def create_media(media_uri, file_path, content_type, slug=nil)
      file_path = Pathname.new(file_path) unless file_path.is_a?(Pathname)
      stream = file_path.open { |f| f.binmode; f.read }
      service = @service_info.get(media_uri)
      if service.nil?
        raise RequestError, "Service information not found. Get service document before you do create_media."
      end
      unless service.accepts_media_type?(content_type)
        raise RequestError, "Unsupported Media Type: #{content_type}"
      end
      create_resource(media_uri, stream, content_type, slug)
      @res['Location']
    end
1227574
private URI createRequestURI(String path,String queryParams) throws URISyntaxException {
        return new URI(j4pServerUrl.getScheme(),
                                  j4pServerUrl.getUserInfo(),
                                  j4pServerUrl.getHost(),
                                  j4pServerUrl.getPort(),
                                  path,
                                  queryParams,null);
    }
556454
public static RedisURI create(String uri) {
        LettuceAssert.notEmpty(uri, "URI must not be empty");
        return create(URI.create(uri));
    }
1064414
def play_backend_uri(argv=None):
    ''''''

    if argv is None:
        argv = sys.argv[1:]
    parser = argparse.ArgumentParser(description='Browse directories and tracks at the given uri and play them/it.')
    parser.add_argument('uri',
                        help='The key that represents some directory belonging to a backend. E.g. plex:album:2323 or spotify:album:xxxx')
    parser.add_argument('-l', '--loglevel', help='Logging level. Default: %(default)s.',
        choices=('debug', 'info', 'warning', 'error'), default='warning')
    args = parse_args_and_apply_logging_level(parser, argv)
    server = getServer()
    hits = server.core.library.browse(args.uri)
    # browse(): Returns a list of mopidy.models.Ref objects for the directories and tracks at the given uri.
    logging.info('Got hits from browse(): %r', hits)
    if len(hits) == 0:
        # try track lookup
        hits = server.core.library.lookup(args.uri)
        logging.info('Got hits from lookup() : %r', hits)

    if len(hits) == 0:
        print('No hits for "{}"'.format(args.uri))
    else:
        server.core.tracklist.clear()
        logging.debug('got special uris: %r', [t['uri'] for t in hits])
        server.core.tracklist.add(uris=[t['uri'] for t in hits])
        server.core.playback.play()