Call this when the user clicks the play/pause button.
514249
def handle_play_pause_clicked(self):
        
        if self.__hardware_source:
            if self.is_playing:
                self.__hardware_source.stop_playing()
            else:
                self.__hardware_source.start_playing()
108475
def pause(self):
		

		# Change playback status only if current status is PLAYING or PAUSED 
		# (and not READY).
		logger.debug("Pausing playback")
		if self.status == PAUSED:
			# Recalculate audio stream position to make sure it is not out of
			# sync with the video
			self.__calculate_audio_frames()
			self.status = PLAYING
			self.clock.pause()
		elif self.status == PLAYING:
			self.status = PAUSED
			self.clock.pause()
505242
async def vafter(self):
        """"""
        self.logger.debug("Finished playing a song")
        if self.state != 'ready':
            self.logger.debug("Returning because player is in state {}".format(self.state))
            return

        self.pause_time = None

        if self.vclient_task:
            loop = asyncio.get_event_loop()
            loop.call_soon(self.vclient_task.cancel)
            self.vclient_task = None

        try:
            if self.streamer is None:
                await self.stop()
                return

            if self.streamer.error is None:
                await self.vplay()
            else:
                self.statuslog.error(self.streamer.error)
                await self.destroy()
        except Exception as e:
            logger.exception(e)
            try:
                await self.destroy()
            except Exception as e:
                logger.exception(e)
23453
def play(self):
        """"""
        if self.state == STATE_PAUSED:
            self._player.set_state(Gst.State.PLAYING)
            self.state = STATE_PLAYING
583466
async def pause(self):
        """"""

        self.logger.debug("pause command")

        if not self.state == 'ready':
            return

        if self.streamer is None:
            return

        try:
            if self.streamer.is_playing():
                self.streamer.pause()
                self.pause_time = self.vclient.loop.time()
                self.statuslog.info("Paused")
        except Exception as e:
            logger.error(e)
            pass
154188
public void setPlaying(boolean playing) {

        if (this.playing.get() == playing) {
            return;
        }

        this.playing.set(playing);

        if (playing) {
            metronome.jumpToBeat(whereStopped.get().getBeat());
            if (isSendingStatus()) {  // Need to also start the beat sender.
                beatSender.set(new BeatSender(metronome));
            }
        } else {
            final BeatSender activeSender = beatSender.get();
            if (activeSender != null) {  // We have a beat sender we need to stop.
                activeSender.shutDown();
                beatSender.set(null);
            }
            whereStopped.set(metronome.getSnapshot());
        }
    }
1167536
@Override
  void onPause() {
    if (impl != null) {
      // note our current play position
      if (impl.isPlaying()) {
        position = impl.getCurrentPosition();
      }
      // release our media player and reset ourselves to the unloaded state
      impl.release();
      impl = null;
    }
  }
254199
function (button, cb) {
            var lastPosition = this._lastMousePosition;
            this._sendEvent('mousedown', lastPosition.x, lastPosition.y, this.BUTTONS[button]);
            this._callCallback(cb);
        }
31279
function(frame) {
                if (this.status != "playing") {
                    return;
                }
                this.time += frame.dur;
                this.setValue(this.getValue());
                if (this.time >= this.duration) {
                    this.timeUp();
                }
                frame.next();
            }
1244020
public static void pause(Context context, String clientId) {
        Intent intent = new Intent(context, PlaybackService.class);
        intent.setAction(ACTION_PAUSE_PLAYER);
        intent.putExtra(BUNDLE_KEY_SOUND_CLOUD_CLIENT_ID, clientId);
        context.startService(intent);
    }
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();
            }
501449
def on_click(self, event):
        
        button = event["button"]
        if button in [1, 4, 5]:
            self.scrolling = True
            self._switch_selection()
        elif button == 3:
            self._apply()
721718
def handle_pause(self):
        """"""
        flag = self.reader.byte()
        if flag > 0:
            logger.info(" -> pause: on")
            self.controller.playing = False
        else:
            logger.info(" -> pause: off")
            self.controller.playing = True
321983
function initReplay() {
  const replayOption = ['record', 'replay'].find(opt => program[opt] === true)
  if (replayOption) process.env.REPLAY = replayOption

  process.env.REPLAY =
    replayOption || (process.env.REPLAY ? process.env.REPLAY : 'bloody')

  if (process.env.REPLAY !== 'bloody') require('replay')
}
269295
function (options) {
      var player = this;

      // otherwise, the animation loop may try and play non-existant frames:
      this.pause();

      // this is called on the context of the recording
      var loadComplete = function (frames) {

        this.setFrames(frames);

        if (player.recording != this){
          console.log('recordings changed during load');
          return
        }

        if (player.autoPlay) {
          player.play();
          if (player.pauseOnHand && !player.controller.streaming() ) {
            player.setGraphic('connect');
          }
        }

        player.controller.emit('playback.recordingSet', this);
      };

      this.recording = options;

      // Here we turn the existing argument in to a recording
      // this allows frames to be added to the existing object via ajax
      // saving ajax requests
      if (!(options instanceof Recording)){

        this.recording.__proto__ = Recording.prototype;
        Recording.call(this.recording, {
          timeBetweenLoops: this.options.timeBetweenLoops,
          loop:             this.options.loop,
          loadProgress: function(recording, percentage, oEvent){
            player.controller.emit('playback.ajax:progress', recording, percentage, oEvent);
          }
        });

      }


      if ( this.recording.loaded() ) {

        loadComplete.call(this.recording, this.recording.frameData);

      } else if (options.url) {

        this.controller.emit('playback.ajax:begin', this, this.recording);

        // called in the context of the recording
        this.recording.loadFrameData(function(frames){
          loadComplete.call(this, frames);
          player.controller.emit('playback.ajax:complete', player, this);
        });

      } else if (options.compressedRecording) {
        this.recording.loadCompressedRecording(options.compressedRecording, function(frames){
          loadComplete.call(this, frames);
        });
      }


      return this;
    }
727487
function onFullscreenClick() {
		if (requestFullscreen) {
			if (player === fullscreenElement()) {
				// exit fullscreen
				exitFullscreen().call(document);
			} else {
				// enter fullscreen
				requestFullscreen.call(player);

				// maintain focus in internet explorer
				self.fullscreen.focus();

				// maintain focus in safari
				setTimeout(() => {
					self.fullscreen.focus();
				}, 200);
			}
		} else if (media.webkitSupportsFullscreen) {
			// iOS allows fullscreen of the video itself
			if (media.webkitDisplayingFullscreen) {
				// exit ios fullscreen
				media.webkitExitFullscreen();
			} else {
				// enter ios fullscreen
				media.webkitEnterFullscreen();
			}

			onFullscreenChange();
		}
	}
14558
def handle_play_pause_clicked(self):
        
        if self.__scan_hardware_source:
            if self.is_playing:
                self.__scan_hardware_source.stop_playing()
            else:
                self.__scan_hardware_source.start_playing()