Clear the playback state stored for a player, such as when it has unloaded the track.

@param player the player number whose playback state is no longer valid
@since 0.5.0
770353
public synchronized void clearPlaybackState(int player) {
        long oldMaxPosition = 0;
        PlaybackState furthestState = getFurthestPlaybackState();
        if (furthestState != null) {
            oldMaxPosition = furthestState.position;
        }
        PlaybackState oldState = playbackStateMap.remove(player);
        long newMaxPosition = 0;
        furthestState = getFurthestPlaybackState();
        if (furthestState != null) {
            newMaxPosition = furthestState.position;
        }
        repaintDueToPlaybackStateChange(oldMaxPosition, newMaxPosition, oldState, null);
    }
411429
public function onPlayerInfoChanged(Player $oldPlayer, Player $player)
    {
        unset($this->players[$player->getLogin()]);
        unset($this->spectators[$player->getLogin()]);

        $this->onPlayerConnect($player);
    }
263731
@VisibleForTesting
    void clear() {
        this.segmentUpdates.clear();
        this.newSegments.clear();
        this.newSegmentNames.clear();
        this.newTruncationPoints.clear();
        this.processedCheckpoint = false;
        resetNewSequenceNumber();
    }
298022
function () {
      if (this.state === 'playing') return;
      if ( this.loading() || this.recording.blank() ) return;

      this.state = 'playing';
      this.controller.connection.protocol = this.playbackProtocol;

      var player = this;

      // prevent the normal controller response while playing
      this.controller.connection.removeAllListeners('frame');
      this.controller.connection.on('frame', function (frame) {
        // resume play when hands are removed:
        if (player.autoPlay && player.state == 'idle' && frame.hands.length == 0) {
          player.play();
        }

        // The default LeapJS callback processes the frame, which is what we do now:
        player.controller.processFrame(frame);
      });

      // Kick off
      this.resetTimers();
      this.recording.readyPlay();
      this.stepFrameLoop();

      this.controller.emit('playback.play', this);
    }
616681
public void clearUnused() {
	Log log = getLog();
	try {
	    // create cleaner engine for session/client scope
	    if (session == null) session = new StorageScopeEngine(factory, log, new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new
		    // SessionEndListener())
		    , new DatasourceStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new
		    // SessionEndListener())
		    // ,new CacheStorageScopeCleaner(Scope.SCOPE_SESSION, new SessionEndListener())
	    });
	    if (client == null) client = new StorageScopeEngine(factory, log,
		    new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_CLIENT, null), new DatasourceStorageScopeCleaner(Scope.SCOPE_CLIENT, null)
		    // ,new CacheStorageScopeCleaner(Scope.SCOPE_CLIENT, null) //Cache storage need no control, if
		    // there is no listener
		    });
	    // store session/client scope and remove from memory
	    storeUnusedStorageScope(factory, Scope.SCOPE_CLIENT);
	    storeUnusedStorageScope(factory, Scope.SCOPE_SESSION);

	    // remove unused memory based client/session scope (invoke onSessonEnd)
	    clearUnusedMemoryScope(factory, Scope.SCOPE_CLIENT);
	    clearUnusedMemoryScope(factory, Scope.SCOPE_SESSION);

	    // session must be executed first, because session creates a reference from client scope
	    session.clean();
	    client.clean();

	    // clean all unused application scopes
	    clearUnusedApplications(factory);
	}
	catch (Exception t) {
	    error(t);
	}
    }
1169001
public synchronized void stop() {
        if (isRunning()) {
            VirtualCdj.getInstance().removeUpdateListener(updateListener);
            running.set(false);
            pendingUpdates.clear();
            queueHandler.interrupt();
            queueHandler = null;

            // Report the loss of our hot cached metadata on the proper thread, outside our lock
            final Set<DeckReference> dyingCache = new HashSet<DeckReference>(hotCache.keySet());
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    for (DeckReference deck : dyingCache) {
                        if (deck.hotCue == 0) {
                            deliverTrackMetadataUpdate(deck.player, null);
                        }
                    }

                }
            });
            hotCache.clear();
            deliverLifecycleAnnouncement(logger, false);
        }
    }
7724
function(player, options) {
  /**
   * Stores user-provided settings.
   * @type {Object}
   */
  this.settings = {};

  /**
   * Content and ads ended listeners passed by the publisher to the plugin.
   * These will be called when the plugin detects that content *and all
   * ads* have completed. This differs from the contentEndedListeners in that
   * contentEndedListeners will fire between content ending and a post-roll
   * playing, whereas the contentAndAdsEndedListeners will fire after the
   * post-roll completes.
   */
  this.contentAndAdsEndedListeners = [];

  /**
   * Whether or not we are running on a mobile platform.
   */
  this.isMobile = (navigator.userAgent.match(/iPhone/i) ||
      navigator.userAgent.match(/iPad/i) ||
      navigator.userAgent.match(/Android/i));

  /**
   * Whether or not we are running on an iOS platform.
   */
  this.isIos = (navigator.userAgent.match(/iPhone/i) ||
      navigator.userAgent.match(/iPad/i));

  this.initWithSettings(options);

  /**
   * Stores contrib-ads default settings.
   */
  const contribAdsDefaults = {
    debug: this.settings.debug,
    timeout: this.settings.timeout,
    prerollTimeout: this.settings.prerollTimeout,
  };
  const adsPluginSettings = this.extend(
      {}, contribAdsDefaults, options.contribAdsSettings || {});

  this.playerWrapper = new PlayerWrapper(player, adsPluginSettings, this);
  this.adUi = new AdUi(this);
  this.sdkImpl = new SdkImpl(this);
}
611910
@Override
    public final void clear(LayoutManagerHelper helper) {
        // remove LayoutViews if there is one
        if (mLayoutView != null) {
            if (mLayoutViewUnBindListener != null) {
                mLayoutViewUnBindListener.onUnbind(mLayoutView, this);
            }
            helper.removeChildView(mLayoutView);
            mLayoutView = null;
        }

        // call user defined
        onClear(helper);
    }
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());
        }
    }
374
@Override
  public void clear() {
    // iterate over all keys in originalMap and set them to null in deltaMap
    for (K key : originalMap.keySet()) {
      deltaMap.put(key, ErasureUtils.<Collection<V>>uncheckedCast(removedValue));
    }
  }
1127753
function () {
    if (player.playing) player.pause()
    else player.play()
    if (player.playing) {
      clickToPlay.style.display = 'none'
    } else {
      clickToPlay.textContent = 'Paused'
      clickToPlay.style.display = 'block'
    }
  }
1249974
public void unload()
    {
        if (mAudioListener != null)
        {
            Log.d("SOUND", "unloading audio source %d %s", getSourceId(), getSoundFile());
            mAudioListener.getAudioEngine().unloadSoundFile(getSoundFile());
        }
        mSoundFile = null;
        mSourceId = GvrAudioEngine.INVALID_ID;
    }
680603
def pause(self):
		
		if self.decoder.status == mediadecoder.PAUSED:
			self.decoder.pause()
			self.paused = False
		elif self.decoder.status == mediadecoder.PLAYING:
			self.decoder.pause()
			self.paused = True
		else:
			print("Player not in pausable state")
1154826
public void removeListener(ILabelProviderListener listener)
	{
		if (fListeners != null)
		{
			fListeners.remove(listener);
			if (fListeners.isEmpty() && fProblemChangedListener != null)
			{
				VdmUIPlugin.getDefault()
						.getProblemMarkerManager()
						.removeListener(fProblemChangedListener);
				fProblemChangedListener = null;
			}
		}
	}
611364
public void removeScrollListener(@NonNull final ScrollListener listener) {
        Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null");
        this.scrollListeners.remove(listener);
    }
343591
private void clearBeatGrids(DeviceAnnouncement announcement) {
        final int player = announcement.getNumber();
        // Iterate over a copy to avoid concurrent modification issues
        for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
            if (deck.player == player) {
                hotCache.remove(deck);
                if (deck.hotCue == 0) {
                    deliverBeatGridUpdate(player, null);  // Inform listeners the beat grid is gone.
                }
            }
        }
    }
1181890
private void clearWaveforms(DeviceAnnouncement announcement) {
        final int player = announcement.getNumber();
        // Iterate over a copy to avoid concurrent modification issues
        for (DeckReference deck : new HashSet<DeckReference>(previewHotCache.keySet())) {
            if (deck.player == player) {
                previewHotCache.remove(deck);
                if (deck.hotCue == 0) {
                    deliverWaveformPreviewUpdate(player, null);  // Inform listeners that preview is gone.
                }
            }
        }
        // Again iterate over a copy to avoid concurrent modification issues
        for (DeckReference deck : new HashSet<DeckReference>(detailHotCache.keySet())) {
            if (deck.player == player) {
                detailHotCache.remove(deck);
                if (deck.hotCue == 0) {
                    deliverWaveformDetailUpdate(player, null);  // Inform listeners that detail is gone.
                }
            }
        }
    }