Play media from an URL on the device.

        Note: This method will not yield until the media has finished playing.
        The Apple TV requires the request to stay open during the entire
        play duration.
4025
async def play_url(self, url, **kwargs):
        
        # If credentials have been loaded, do device verification first
        if self.identifier:
            await self.verify_authenticated()

        position = 0 if 'position' not in kwargs else int(kwargs['position'])
        return await self.player.play_url(url, position)
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
511049
async def download_media(self, *args, **kwargs):
        
        return await self._client.download_media(self, *args, **kwargs)
771877
function() {
		var api_url,
			self = this;

		// Create Dom element
		this._el.content_item	= TL.Dom.create("div", "tl-media-item tl-media-iframe tl-media-dailymotion", this._el.content);

		// Get Media ID
		if (this.data.url.match("video")) {
			this.media_id = this.data.url.split("video\/")[1].split(/[?&]/)[0];
		} else {
			this.media_id = this.data.url.split("embed\/")[1].split(/[?&]/)[0];
		}

		// API URL
		api_url = "https://www.dailymotion.com/embed/video/" + this.media_id+"?api=postMessage";

		// API Call
		this._el.content_item.innerHTML = "<iframe autostart='false' frameborder='0' width='100%' height='100%' src='" + api_url + "'></iframe>"

		// After Loaded
		this.onLoaded();
	}
220248
private static Playback createPlayback(Media media, Align alignment, int volume) throws IOException
    {
        final AudioInputStream input = openStream(media);
        final SourceDataLine dataLine = getDataLine(input);
        dataLine.start();
        updateAlignment(dataLine, alignment);
        updateVolume(dataLine, volume);

        return new Playback(input, dataLine);
    }
1071592
async def play(self):
        
        if self.repeat and self.current is not None:
            self.queue.append(self.current)

        self.current = None
        self.position = 0
        self._paused = False

        if not self.queue:
            await self.stop()
        else:
            self._is_playing = True
            if self.shuffle:
                track = self.queue.pop(randrange(len(self.queue)))
            else:
                track = self.queue.pop(0)

            self.current = track
            log.debug("Assigned current.")
            await self.node.play(self.channel.guild.id, track)
605866
def play(self, sound):
        
        self.is_done.clear()  # hold is_done until the sound is played
        if self.sr != sound.sr:
            raise ValueError('You can only play sound with a samplerate of {} (here {}). Use the Sound.resample method for instance.', self.sr, sound.sr)

        if sound in self.sounds:
            self.remove(sound)

        with self.chunk_available:
            self.sounds.append(sound)
            sound.playing = True

            self.chunk_available.notify()
        self.is_done.wait()
849656
async def print_what_is_playing(loop):
    """"""
    print('Discovering devices on network...')
    atvs = await pyatv.scan_for_apple_tvs(loop, timeout=5)

    if not atvs:
        print('no device found', file=sys.stderr)
        return

    print('Connecting to {0}'.format(atvs[0].address))
    atv = pyatv.connect_to_apple_tv(atvs[0], loop)

    try:
        playing = await atv.metadata.playing()
        print('Currently playing:')
        print(playing)
    finally:
        # Do not forget to logout
        await atv.logout()
327162
def download_permanent_media(self, media_id):
        
        return requests.post(
            url="https://api.weixin.qq.com/cgi-bin/material/get_material",
            params={"access_token": self.token},
            data=_json.dumps({
                "media_id": media_id
            }, ensure_ascii=False).encode("utf-8")
        )
297319
private void loadMultimediaFile(URL mediaFileURL)
	{
    	try
    	{
    		if (mediaFileURL!=null)
    		{
    			MultimediaContainer newContainer = MultimediaContainerManager.getMultimediaContainer(mediaFileURL);
    			if (newContainer!=null) currentContainer = newContainer;
    		}
    	}
    	catch (Throwable ex)
    	{
			Log.error("[MainForm::loadMultimediaFile] Loading of " + mediaFileURL + " failed!", ex);
			currentContainer = null;
    	}
    	finally
    	{
			// if we are currently playing, start the current piece:
			if (playerThread!=null) doStartPlaying();
    	}
	}
1151795
function onLoadStart() {
		media.removeEventListener('canplaythrough', onCanPlayStart);

		$(media, { canplaythrough: onCanPlayStart });

		$(self.download, { href: media.src, download: media.src });

		onPlayChange();
		onVolumeChange();
		onFullscreenChange();
		onTimeChange();
	}
114365
def play(file_or_url, options = {})
      @players = @devices.map { |device| device.play(file_or_url, options) }
      Players.new(@players)
    end
1031997
protected boolean loadMultimediaFile(URL mediaFileURL)
	{
    	try
    	{
    		if (mediaFileURL!=null)
    		{
    			MultimediaContainer newContainer = MultimediaContainerManager.getMultimediaContainer(mediaFileURL);
    			if (newContainer!=null)
    			{
    				currentContainer = newContainer;
    				setNewSongName(currentContainer.getSongName());
    			}
    		}
    	}
    	catch (Throwable ex)
    	{
			Log.error("[Applet::loadMultimediaFile] Loading of " + mediaFileURL + " failed!", ex);
			return false;
    	}
		setPlayListIcons();
		// if we are currently playing, start the current piece:
		if (playerThread!=null) doStartPlaying();
		return true;
	}
506727
def play(self, name, streamUrl, encoding = ''):
        
        self.close()
        self.name = name
        self.oldUserInput = {'Input': '', 'Volume': '', 'Title': ''}
        self.muted = False
        self.show_volume = True
        self.title_prefix = ''
        self.playback_is_on = False
        self.outputStream.write('Station: "{}"'.format(name), self.status_update_lock)
        if logger.isEnabledFor(logging.INFO):
            logger.info('Selected Station: "{}"'.format(name))
        if encoding:
            self._station_encoding = encoding
        else:
            self._station_encoding = 'utf-8'
        opts = []
        isPlayList = streamUrl.split("?")[0][-3:] in ['m3u', 'pls']
        opts = self._buildStartOpts(streamUrl, isPlayList)
        self.process = subprocess.Popen(opts, shell=False,
                                        stdout=subprocess.PIPE,
                                        stdin=subprocess.PIPE,
                                        stderr=subprocess.STDOUT)
        t = threading.Thread(target=self.updateStatus, args=(self.status_update_lock, ))
        t.start()
        # start playback check timer thread
        try:
            self.connection_timeout_thread = threading.Timer(self.playback_timeout, self.playback_timeout_handler)
            self.connection_timeout_thread.start()
        except:
            self.connection_timeout_thread = None
            if (logger.isEnabledFor(logging.ERROR)):
                logger.error("playback detection thread start failed")
        if logger.isEnabledFor(logging.INFO):
            logger.info("Player started")
546767
def download_media(self, media_id):
        
        return requests.get(
            url="https://api.weixin.qq.com/cgi-bin/media/get",
            params={
                "access_token": self.token,
                "media_id": media_id
            }
        )
360560
def stream_url(self):
        """"""
        rtsp_url = RTSP_URL.format(
            host=self.config.host, video=self.video_query,
            audio=self.audio_query, event=self.event_query)
        _LOGGER.debug(rtsp_url)
        return rtsp_url
231190
private void play(Media media, Align alignment)
    {
        try (Playback playback = createPlayback(media, alignment, volume))
        {
            if (opened.containsKey(media))
            {
                opened.get(media).close();
            }
            opened.put(media, playback);

            final AudioInputStream input = openStream(media);
            final SourceDataLine dataLine = playback.getDataLine();
            dataLine.start();
            readSound(input, dataLine);
            close(input, dataLine);
        }
        catch (final IOException exception)
        {
            if (last == null || !exception.getMessage().equals(last.getMessage()))
            {
                Verbose.exception(exception, media.toString());
                last = exception;
            }
        }
    }