videogular / videogular2

The HTML5 video player for Angular 2
https://videogular.github.io/videogular2-showroom/#/
MIT License
672 stars 211 forks source link

Seekbar goes crazy when out of width #810

Open BleedingDev opened 5 years ago

BleedingDev commented 5 years ago

Description

When I move out of seekbar (its width to be correct) it nondeterministicaly jumps to random times.

Current setup

https://mybrowser.fyi/report/5c3f57cc8d118e0014b1a7d1 (Chrome Canary) https://mybrowser.fyi/report/5c3f57f78d118e0014b1a7d2 (Vivaldi) https://mybrowser.fyi/report/5c3f582f8d118e0014b1a7d4 (Safari)

Expected Behavior

When I move out of seekbar it should stay at 00:00/end of video.

Actual Behavior

It nondeterministicaly jumps to random times.

Steps to Reproduce

  1. Leftclick on seekbar
  2. Move out of videoplayer (out of width, not height)
  3. Look at seekbar jumping

Attachments

You can try it here https://videogular.github.io/videogular2-showroom/#/single-player

Stroncii commented 5 years ago

Any updates?

pyrextor commented 3 years ago

Still having this behaviour, when moving out from the end it keeps at the end, but when moving out of the start, it goes crazy.

pyrextor commented 3 years ago

I have solved it getting the videogular2 package out of node_modules and using it as an angular element and modifying this code on videogular2/src/controls/vg-scrub-bar/vg-scrub-bar.jsvg-scrub-bar.js

VgScrubBar.prototype.onMouseMoveScrubBar = function ($event) { if (this.target) { if (!this.target.isLive && this.vgSlider && this.isSeeking) { if ( !this.API.fsAPI.isFullscreen && Math.abs(Number($event.clientX) - Number($event.offsetX)) > 5 ) { this.offsetX = $event.offsetX; this.seekMove($event.offsetX); } } } };

VgScrubBar.prototype.onMouseUpScrubBar = function ($event) { if (this.target) { if (!this.target.isLive && this.vgSlider && this.isSeeking) { if ( !this.API.fsAPI.isFullscreen && Math.abs(Number($event.clientX) - Number($event.offsetX)) > 5 ) this.seekEnd($event.offsetX); else this.seekEnd(this.offsetX); } } };

pyrextor commented 3 years ago

I have fixed it better and created a pull-request.