Hook the DraggableListener to DraggablePanel to pause or resume the video when the
DragglabePanel is maximized or closed.
343285
private void hookDraggablePanelListeners() {
    draggablePanel.setDraggableListener(new DraggableListener() {
      @Override public void onMaximized() {
        playVideo();
      }

      @Override public void onMinimized() {
        //Empty
      }

      @Override public void onClosedToLeft() {
        pauseVideo();
      }

      @Override public void onClosedToRight() {
        pauseVideo();
      }
    });
  }
341201
private void triggerOnReleaseActionsWhileVerticalDrag(float yVel) {
    if (yVel < 0 && yVel <= -Y_MIN_VELOCITY) {
      draggableView.maximize();
    } else if (yVel > 0 && yVel >= Y_MIN_VELOCITY) {
      draggableView.minimize();
    } else {
      if (draggableView.isDragViewAboveTheMiddle()) {
        draggableView.maximize();
      } else {
        draggableView.minimize();
      }
    }
  }
1129823
function handleDocumentMousemove(e) {
  let annotationId = overlay.getAttribute('data-target-id');
  let parentNode = overlay.parentNode;
  let rect = parentNode.getBoundingClientRect();
  let y = (dragStartY + (e.clientY - dragOffsetY));
  let x = (dragStartX + (e.clientX - dragOffsetX));
  let minY = 0;
  let maxY = rect.height;
  let minX = 0;
  let maxX = rect.width;

  if (y > minY && y + overlay.offsetHeight < maxY) {
    overlay.style.top = `${y}px`;
  }

  if (x > minX && x + overlay.offsetWidth < maxX) {
    overlay.style.left = `${x}px`;
  }
}
1362937
function EventLoop() {
    var renderCallbacks = [],
        intervalId,
        startInternal = function () {
            intervalId = requestAnimationFrame(startInternal);
            for (var i = 0, n = renderCallbacks.length; i < n; ++i) {
                renderCallbacks[i]();
            }
        };

    this.onRender = function (callback) {
        if (typeof callback === 'function') {
            renderCallbacks.push(callback);
        }
    };
    this.start = function () {
        startInternal();
    };
    this.stop = function () {
        if (intervalId) {
            cancelAnimationFrame(intervalId);
            intervalId = null;
        }
    };
}
652477
function onResizeEnd() {
            utils.dragInfo.inDragging = false;
            utils.dragInfo.justResized = true; // if winJustDragged, should force children re-render
            setTimeout(function () {
              utils.dragInfo.justResized = false;
            }, 1200);

            refreshFrame();
          }
279723
def OnMouseWheel(self, event):
        """"""

        if event.	ShiftDown():
            self.OnShiftVideo(event)
        else:
            self.OnAdjustVolume(event)
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")
1226360
private void stopLoadingAnimation() {

        if (m_loadingTimer != null) {
            m_loadingTimer.cancel();
        }
        if (m_clientLoading) {
            m_contentWrapper.remove(m_loadingPanel);
            doResize();
            m_clientLoading = false;
        }
    }
304985
function onActivateEvent() {
         if (this.animatedTilesets === undefined) {
           this.animatedTilesets = [];
         }

         if (this.tilesets) {
           var tileset = this.tilesets.tilesets;

           for (var i = 0; i < tileset.length; i++) {
             if (tileset[i].isAnimated) {
               this.animatedTilesets.push(tileset[i]);
             }
           }
         }

         this.isAnimated = this.animatedTilesets.length > 0; // Force pre-render off when tileset animation is used

         if (this.isAnimated) {
           this.preRender = false;
         } // Resize the bounding rect


         this.getBounds().resize(this.width, this.height);
       }
234629
function (globalEasing) {

        var self = this;
        var clipCount = 0;

        var oneTrackDone = function() {
            clipCount--;
            if (clipCount === 0) {
                self._doneCallback();
            }
        };

        var lastClip;
        for (var propName in this._tracks) {
            var clip = createTrackClip(
                this, globalEasing, oneTrackDone,
                this._tracks[propName], propName, self._interpolater, self._maxTime
            );
            if (clip) {
                this._clipList.push(clip);
                clipCount++;

                // If start after added to animation
                if (this.animation) {
                    this.animation.addClip(clip);
                }

                lastClip = clip;
            }
        }

        // Add during callback on the last clip
        if (lastClip) {
            var oldOnFrame = lastClip.onframe;
            lastClip.onframe = function (target, percent) {
                oldOnFrame(target, percent);

                for (var i = 0; i < self._onframeList.length; i++) {
                    self._onframeList[i](target, percent);
                }
            };
        }

        if (!clipCount) {
            this._doneCallback();
        }
        return this;
    }
641424
private void updateGUIAfterLoadingVisualizer(
    LoadableVisualizer.Callback callback)
  {
    if (callback != null && vis instanceof LoadableVisualizer)
    {
      LoadableVisualizer loadableVis = (LoadableVisualizer) vis;
      if (loadableVis.isLoaded())
      {
        // direct call callback since the visualizer is already ready
        callback.visualizerLoaded(loadableVis);
      }
      else
      {
        loadableVis.clearCallbacks();
        // add listener when player was fully loaded
        loadableVis.addOnLoadCallBack(callback);
      }
    }

    progress.setEnabled(false);
    progress.setVisible(false);

    if (vis != null)
    {
      btEntry.setEnabled(true);
      vis.setVisible(true);
      if (vis instanceof PDFViewer)
      {
        ((PDFViewer) vis).openPDFPage("-1");
      }
      if (vis instanceof MediaPlayer)
      {
        // if this is a media player visualizer, close all other media players
        // since some browsers (e.g. Chrome) have problems if there are multiple
        // audio/video elements on one page
        MediaController mediaController = VaadinSession.getCurrent().
          getAttribute(
            MediaController.class);
        mediaController.closeOtherPlayers((MediaPlayer) vis);

      }
      // add if not already added
      if (getComponentIndex(vis) < 0)
      {
        addComponent(vis);
      }
    }
  }
976257
function () {
            if (aria.utils.dragdrop && aria.utils.dragdrop.Drag) {
                this._createDraggable();
            } else {
                Aria.load({
                    classes : ["aria.utils.dragdrop.Drag"],
                    oncomplete : {
                        fn : this._createDraggable,
                        scope : this
                    }
                });
            }
        }
137747
public void dragElementTo(String draggable, String droppable, int waitForMillies) throws InterruptedException {
		WebElement draggableEl = translateLocatorToWebElement(draggable);
		WebElement dragReceiver = translateLocatorToWebElement(droppable);

		Actions clickAndDrag = new Actions(getWebDriver());
		clickAndDrag.dragAndDrop(draggableEl, dragReceiver);
		clickAndDrag.perform();

		// ToDO: clarify what to do with the parameter waitForMillies
	}
465842
@Override
    public void onSeekComplete(MediaPlayer mp) {
        Log.d(TAG, "onSeekComplete");

        stopLoading();
        if (lastState != null) {
            switch (lastState) {
                case STARTED: {
                    start();
                    break;
                }
                case PLAYBACKCOMPLETED: {
                    currentState = State.PLAYBACKCOMPLETED;
                    break;
                }
                case PREPARED: {
                    currentState = State.PREPARED;
                    break;
                }
            }
        }

        if (this.seekCompleteListener != null)
            this.seekCompleteListener.onSeekComplete(mp);
    }
927572
function pause() {
        $this->paused = true;
        
        if($this->started && !$this->closed) {
            $this->driver->pauseStreamConsumption();
        }
    }
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;
    }
884877
function () {
            if (!this._popup || !this._popup.isOpen || this._draggable) {
                // maybe the popup was closed while loading aria.utils.dragdrop.Drag,
                // or it was closed and re-opened very quickly (and we should avoid
                // creating the _draggable object twice)
                return;
            }
            this._draggable = new aria.utils.dragdrop.Drag(this._domElt, {
                handle : this._titleBarDomElt,
                cursor : "move",
                proxy : this._cfg.movableProxy,
                constrainTo : this._popupContainer.getContainerRef(),
                dragOverIFrame : true
            });
            this._draggable.$on({
                "dragstart" : {
                    fn : this._onDragStart,
                    scope : this
                },
                "move" : {
                    fn : this._onDragMove,
                    scope : this
                },
                "dragend" : {
                    fn : this._onDragEnd,
                    scope : this
                }
            });
        }