Pause at given position. Required as "pausePlayback" can be "null" if no flag is passed by the client

@param pausePlayback
Pause playback or not
@param position
Pause position
968900
public void pause(Boolean pausePlayback, int position) {
        IConnection conn = Red5.getConnectionLocal();
        if (conn instanceof IStreamCapableConnection) {
            IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
            Number streamId = conn.getStreamId();
            IClientStream stream = streamConn.getStreamById(streamId);
            if (stream != null && stream instanceof ISubscriberStream) {
                ISubscriberStream subscriberStream = (ISubscriberStream) stream;
                // pausePlayback can be "null" if "pause" is called without any parameters from flash
                if (pausePlayback == null) {
                    pausePlayback = !subscriberStream.isPaused();
                }
                if (pausePlayback) {
                    subscriberStream.pause(position);
                } else {
                    subscriberStream.resume(position);
                }
            }
        }
    }
103466
public void pause() throws IllegalStateException {
        Log.d(TAG, "pause");
        if (mediaPlayer != null) {
            currentState = State.PAUSED;
            mediaPlayer.pause();
        } else throw new RuntimeException("Media Player is not initialized");
    }
1015235
public void resume(int position) throws IllegalStateException {
        // allow resume from pause
        switch (subscriberStream.getState()) {
            case PAUSED:
                subscriberStream.setState(StreamState.PLAYING);
                sendReset();
                sendResumeStatus(currentItem.get());
                if (pullMode) {
                    sendVODSeekCM(position);
                    subscriberStream.onChange(StreamState.RESUMED, currentItem.get(), position);
                    playbackStart = System.currentTimeMillis() - position;
                    long length = currentItem.get().getLength();
                    if (length >= 0 && (position - streamOffset) >= length) {
                        // Resume after end of stream
                        stop();
                    } else {
                        ensurePullAndPushRunning();
                    }
                } else {
                    subscriberStream.onChange(StreamState.RESUMED, currentItem.get(), position);
                    videoFrameDropper.reset(VideoFrameDropper.SEND_KEYFRAMES_CHECK);
                }
                break;
            default:
                throw new IllegalStateException("Cannot resume from non-paused state");
        }
    }
1186088
def toggle_play_pause(self):
        """"""
        # Use Play/Pause button only for sources which support NETAUDIO
        if (self._state == STATE_PLAYING and
                self._input_func in self._netaudio_func_list):
            return self._pause()
        elif self._input_func in self._netaudio_func_list:
            return self._play()
1048803
public void pause(@NonNull View sceneRoot) {
        if (!mEnded) {
            synchronized (sRunningAnimators) {
                ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();
                int numOldAnims = runningAnimators.size();
                Object windowId = ViewUtils.getWindowId(sceneRoot);
                for (int i = numOldAnims - 1; i >= 0; i--) {
                    AnimationInfo info = runningAnimators.valueAt(i);
                    if (info.view != null && windowId != null && windowId.equals(info.windowId)) {
                        Animator anim = runningAnimators.keyAt(i);
                        AnimatorUtils.pause(anim);
                    }
                }
            }
            if (mListeners != null && mListeners.size() > 0) {
                ArrayList<TransitionListener> tmpListeners =
                        (ArrayList<TransitionListener>) mListeners.clone();
                int numListeners = tmpListeners.size();
                for (int i = 0; i < numListeners; ++i) {
                    tmpListeners.get(i).onTransitionPause(this);
                }
            }
            mPaused = true;
        }
    }
1101469
public function stopPlayback($playbackId)
    {
        $uri = "playbacks/$playbackId";
        try {
            $this->client->getEndpoint()->delete($uri);
        } catch (RequestException $e) {
            $this->processRequestException($e);
        }
    }
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()
519380
private void resume() {
        if (mIsPaused) {
            mIsPaused = false;
            mIsPausedAfterAudioFocusChanged = false;
            // Try to gain the audio focus before preparing and starting the media player.
            if (mAudioManager.requestAudioFocus(this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN)
                    == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
                mMediaPlayer.start();

                Intent intent = new Intent(PlaybackListener.ACTION_ON_TRACK_PLAYED);
                intent.putExtra(PlaybackListener.EXTRA_KEY_TRACK,
                        mPlayerPlaylist.getCurrentTrack());
                mLocalBroadcastManager.sendBroadcast(intent);

                updateNotification();
                mMediaSession.setPlaybackState(MediaSessionWrapper.PLAYBACK_STATE_PLAYING);
                resumeTimer();
            }
        }
    }
6659
public void pause() {
        if (hasState(TICKING) && !hasState(PAUSED)) {
            if (DBG) Log.v(TAG, "pause. " + mEntries.size());
            mContentView.animate().cancel();
            addState(PAUSED);
            cancel(-1);
        }
    }
266234
final public void addPosition(int position) {
    if (tokenPosition == null) {
      tokenPosition = new MtasPosition(position);
    } else {
      tokenPosition.add(position);
    }
  }
46207
async def pause(self, pause: bool = True):
        
        self._paused = pause
        await self.node.pause(self.channel.guild.id, pause)
627570
public static void pause(long delay)
    {
        try
        {
            Thread.sleep(delay);
        }
        catch (@SuppressWarnings("unused") final InterruptedException exception)
        {
            Thread.currentThread().interrupt();
        }
    }
651061
def pause(self, remaining_pause_cycles):
        """"""
        url = urljoin(self._url, '/pause')
        elem = ElementTreeBuilder.Element(self.nodename)
        elem.append(Resource.element_for_value('remaining_pause_cycles',
                                               remaining_pause_cycles))
        body = ElementTree.tostring(elem, encoding='UTF-8')

        response = self.http_request(url, 'PUT', body, { 'Content-Type':
            'application/xml; charset=utf-8' })

        if response.status not in (200, 201, 204):
            self.raise_http_error(response)

        self.update_from_element(ElementTree.fromstring(response.read()))
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;
    }
  }
54265
public void dragAndDropWithPause(String locator, String targetLocator, int pause)
	{
		dragAndDropToObject(locator, targetLocator);
		jtCore.pause(pause);
	}
953658
def pauseMovie(self):
    """"""
    if self.state == self.PLAYING:
      self.sendRtspRequest(self.PAUSE)
1220584
protected void playSlide(int currentPosition, int previousPosition) {
        final SlideStatus slideStatus = adapter.getSlideStatus(currentPosition);
        final PlayList pl = getPlaylist();

        // Don't play anything if we have reached the end
        if (currentPosition < 0) {
            stop();
            return;
        }

        // Stop anything planned
        slideHandler.removeCallbacksAndMessages(null);

        // If the slide is ready, then we can display it straight away
        switch (slideStatus) {
            case READY:
                notAvailableSlidesSkipped = 0;

                // We are playing the slide show!
                status = Status.PLAYING;

                // Schedule next slide
                if (pl.isAutoAdvanceEnabled()) {
                    slideHandler.postDelayed(moveToNextSlide, pl.getSlideDuration(currentPosition));
                }

                // Display the slide
                displaySlide(currentPosition, previousPosition);

                break;

            case NOT_AVAILABLE:
                Log.w("SlideShowView", "Slide is not available: " + currentPosition);

                // Stop if we have already skipped all slides
                ++notAvailableSlidesSkipped;
                if (notAvailableSlidesSkipped < adapter.getCount()) {
                    prepareSlide(pl.getNextSlide());
                    next();
                } else {
                    Log.w("SlideShowView", "Skipped too many slides in a row. Stopping playback.");
                    stop();
                }
                break;

            case LOADING:
                Log.d("SlideShowView", "Slide is not yet ready, waiting for it: " + currentPosition);

                // Show an indicator to the user
                showProgressIndicator();

                // Start waiting for the slide to be available
                waitForCurrentSlide.startWaiting(currentPosition, previousPosition);

                break;
        }
    }