when the media can play
976576
function onCanPlayStart() {
		media.removeEventListener('canplaythrough', onCanPlayStart);

		// dispatch new "canplaystart" event
		dispatchCustomEvent(media, 'canplaystart');

		if (!paused || media.autoplay) {
			media.play();
		}
	}
1092017
function(){
                /*
                 * expression
                 *  : '(' S* media_feature S* [ ':' S* expr ]? ')' S*
                 *  ;
                 */
                var tokenStream = this._tokenStream,
                    feature     = null,
                    token,
                    expression  = null;

                tokenStream.mustMatch(Tokens.LPAREN);
                feature = this._media_feature();
                this._readWhitespace();

                if (tokenStream.match(Tokens.COLON)){
                    this._readWhitespace();
                    token = tokenStream.LT(1);
                    expression = this._expression();
                }

                tokenStream.mustMatch(Tokens.RPAREN);
                this._readWhitespace();
                return new MediaFeature(feature, (expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null));
            }
181948
function shareReplay(bufferSize, windowTime, scheduler) {
    return function (source) { return source.lift(shareReplayOperator(bufferSize, windowTime, scheduler)); };
}
90548
public void setMedia(String media) throws FlickrException {
        if (media.equals("all") || media.equals("photos") || media.equals("videos")) {
            this.media = media;
        } else {
            throw new FlickrException("0", "Media type is not valid.");
        }
    }
69280
function getStartEnd(item, media) {
  let { start, end } = item;
  if (!start || start < 0) {
    start = 0;
  } else if (start > media.duration) {
    start = media.duration;
  }
  if (!end || end > media.duration) {
    end = media.duration;
  } else if (end < start) {
    end = start;
  }
  return { start, end };
}
1023964
def media(self):
        
        return self.widget.media + self.checkbox.media + Media(self.Media)
734406
function(e) {
              that.environment = {
                flash:e.jPlayer.flash.used,
                html:e.jPlayer.html.used
              };
              that.flagPlayerReady = true;
              that.loadTrack(that.options.url);
              if(that.options.autoPlay) {
                if(that.environment.flash){
                  that.player.jPlayer('play');
                } else {
                  that.doOnCanPlay = function(){
                    that.player.jPlayer('play');
                  };
                }
              }
              that.options.onReady();
            }
1072816
async def play(self, ctx, *, query):
        """"""

        source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(query))
        ctx.voice_client.play(source, after=lambda e: print('Player error: %s' % e) if e else None)

        await ctx.send('Now playing: {}'.format(query))
545560
def do_media(self, args):
        """"""
        func = getattr(args, 'func', None)
        if func is not None:
            # Call whatever subcommand function was selected
            func(self, args)
        else:
            # No subcommand was provided, so call help
            self.do_help('media')
27823
public boolean mediaIsVideo () {
        String contentType = this.getContentType();
        return contentType != null && this.media != null && contentType.startsWith("video");
    }
143605
def media_type_str(mediatype):
    """"""
    if mediatype == const.MEDIA_TYPE_UNKNOWN:
        return 'Unknown'
    if mediatype == const.MEDIA_TYPE_VIDEO:
        return 'Video'
    if mediatype == const.MEDIA_TYPE_MUSIC:
        return 'Music'
    if mediatype == const.MEDIA_TYPE_TV:
        return 'TV'
    return 'Unsupported'
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;
            }
        }
    }
512024
public void play() {
        checkState();
        if (mState == STATE_PAUSED) {
            PlaybackService.resume(getContext(), mClientKey);
        } else if (mState == STATE_STOPPED) {
            SoundCloudTrack track = mPlayerPlaylist.getCurrentTrack();
            if (track != null) {
                PlaybackService.play(getContext(), mClientKey, track);
            } else {
                return;
            }
        }
        mState = STATE_PLAYING;
    }
474490
async def get_play_info(self) -> PlayInfo:
        """"""
        info = await self.services["avContent"]["getPlayingContentInfo"]({})
        return PlayInfo.make(**info.pop())
858940
function play(name) {
        if (name === 'list') {
            return Object.keys(audio);
        }
        if (!(name in audio)) {
            d.error("Invalid audio name:", name);
            return;
        }

        audio[name].play();
    }
736643
protected void nativePlay(Element video) {
        MediaStream stream = null;
        if (Navigator.getUserMedia != null) {
            stream = Navigator.getUserMedia;
            GWT.log("Uses Default user Media");
        } else if (Navigator.webkitGetUserMedia != null) {
            stream = Navigator.webkitGetUserMedia;
            GWT.log("Uses Webkit User Media");
        } else if (Navigator.mozGetUserMedia != null) {
            stream = Navigator.mozGetUserMedia;
            GWT.log("Uses Moz User Media");
        } else if (Navigator.msGetUserMedia != null) {
            stream = Navigator.msGetUserMedia;
            GWT.log("Uses Microsoft user Media");
        } else {
            GWT.log("No supported media found in your browser");
        }

        if (stream != null) {
            Navigator.getMedia = stream;
            Constraints constraints = new Constraints();
            constraints.audio = false;

            MediaTrackConstraints mediaTrackConstraints = new MediaTrackConstraints();
            mediaTrackConstraints.width = width;
            mediaTrackConstraints.height = height;
            mediaTrackConstraints.facingMode = facingMode.getName();
            constraints.video = mediaTrackConstraints;

            Navigator.mediaDevices.getUserMedia(constraints).then(streamObj -> {
                mediaStream = (MediaStream) streamObj;
                if (URL.createObjectURL(mediaStream) != null) {
                    $(video).attr("src", URL.createObjectURL(mediaStream));
                } else if (WebkitURL.createObjectURL(mediaStream) != null) {
                    $(video).attr("src", WebkitURL.createObjectURL(mediaStream));
                }
                if (video instanceof VideoElement) {
                    ((VideoElement) video).play();
                }
                onCameraCaptureLoad();
                return null;
            }).catchException(error -> {
                GWT.log("MaterialCameraCapture: An error occured! " + error);
                onCameraCaptureError(error.toString());
                return null;
            });
        }
    }
682733
def handle_netusb(self, message):
        """"""
        # _LOGGER.debug("message: {}".format(message))
        needs_update = 0

        if self._yamaha:
            if 'play_info_updated' in message:
                play_info = self.get_play_info()
                # _LOGGER.debug(play_info)
                if play_info:
                    new_media_status = MediaStatus(play_info, self._ip_address)

                    if self._yamaha.media_status != new_media_status:
                        # we need to send an update upwards
                        self._yamaha.new_media_status(new_media_status)
                        needs_update += 1

                    playback = play_info.get('playback')
                    # _LOGGER.debug("Playback: {}".format(playback))
                    if playback == "play":
                        new_status = STATE_PLAYING
                    elif playback == "stop":
                        new_status = STATE_IDLE
                    elif playback == "pause":
                        new_status = STATE_PAUSED
                    else:
                        new_status = STATE_UNKNOWN

                    if self._yamaha.status is not new_status:
                        _LOGGER.debug("playback: %s", new_status)
                        self._yamaha.status = new_status
                        needs_update += 1

        return needs_update