viewer icon indicating copy to clipboard operation
viewer copied to clipboard

disable previous / next video preloading

Open olaulau opened this issue 10 months ago • 8 comments

Is your feature request related to a problem? Please describe. when playing some high rate video (from a gopro for example), with many in the same folder, the viewer preloads simultaneously the previous and the next video, which can be very laggy.

Describe the solution you'd like we could :

  • totally disable video preloading there : https://github.com/nextcloud/viewer/blob/aee0712b4114124a1562e3740e2cd35332b21012/src/components/Videos.vue#L39
  • disable preloading for previous / next video only
  • only preload after a while, when the current video is buffered and already playing
  • have a setting that allows user to disable this globally, or maybe per folder

Describe alternatives you've considered I don't really know how to develop with vue.js and compile this sources, but I figured out this workaround :

  • in nextcloud dir, edit : apps/viewer/js/viewer-main.js
  • find {ref:"video",attrs:{autoplay:!!e.active||null,playsinline:!0,poster:e.livePhotoPath,src:e.src,preload:"metadata"}
  • change "metadata" to "none" we can see in FF network debugger that only one video file is requested (before we could see 3 different videos requested)

Additional context it is not a cpu problem, my hosting server is ok, it's really a bandwidth problem, which is felt more from internet than locally.

olaulau avatar Apr 04 '24 18:04 olaulau

Agree, I have lots of videos on a 100Mbps server with Nextcloud, and I observed very poor performance when previewing these videos. However, there is no problem when using the sharing link to view a single video file.

PS. I use this Nextcloud instance which only have 1 user

DGideas avatar Jul 09 '24 03:07 DGideas

Preload metadata should only load a few KB of video, I'm surprised that has such a big effect on your servers.

I have lots of videos on a 100Mbps server

Well, that would epxlain it, 100mbps is really low for a server serving videos :/

skjnldsv avatar Jul 09 '24 08:07 skjnldsv

Preload metadata should only load a few KB of video, I'm surprised that has such a big effect on your servers.

it does not load only metadata but the whole video

I have lots of videos on a 100Mbps server

Well, that would epxlain it, 100mbps is really low for a server serving videos :/

it's not a slow host if you have only one user. and I had same problem with a great host and a 700M uplink !

olaulau avatar Jul 09 '24 08:07 olaulau

Is any of you in Nextcloud 29 ?

skjnldsv avatar Jul 26 '24 08:07 skjnldsv

@olaulau what is the total size downloaded by your browser on the preloaded videos? For me it reaches maybe 1-2MB max :thinking:

skjnldsv avatar Jul 26 '24 09:07 skjnldsv

migrated to nextcloud hub 8 (29.0.3). still loading 3 different video files. when the video starts playing, browser has already loaded more that 100MB (cleared the network view and filtering only media type)

olaulau avatar Jul 26 '24 09:07 olaulau

100MB from videos other than the current one you mean?

skjnldsv avatar Jul 26 '24 09:07 skjnldsv

yes, filtering with current file shows only a third of total media transferred.

olaulau avatar Jul 26 '24 09:07 olaulau