files_mediaviewer icon indicating copy to clipboard operation
files_mediaviewer copied to clipboard

Spinner doesn't disappear when download stalled

Open PVince81 opened this issue 6 years ago • 4 comments

Discovered while testing https://github.com/owncloud/files_mediaviewer/pull/36.

:warning: not easy to reproduce due to delays.

Steps

  1. Clear caches
  2. Have lots of videos in the list
  3. Open the network console for observation
  4. Click the first video and directly start its playback

Expected result

Playback, while delayed, starts eventually and spinner disappears.

Actual result

Playback is delayed because the browser is loading the other video's previews and is still busy, as observed in the network console. If this takes more than a few seconds, the video element from the first picture believes that the download is stalled and aborts. The console shows a message that the download is stalled (I can't reproduce it now so can't paste it).

In any case, the stalling is ok but when it happens the spinner does not disappear and stays overlayed on top of the playing video. Maybe it needs some error detection.

Sadly I can't reproduce this any more despite clearing caches.

@felixheidecke

PVince81 avatar Feb 13 '19 11:02 PVince81

Ok managed to reproduce it somehow, add this to the server:

diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php
index 8529446a0b..5df168d0f4 100644
--- a/lib/private/legacy/files.php
+++ b/lib/private/legacy/files.php
@@ -100,6 +100,7 @@ class OC_Files {
         * @param array $params ; 'head' boolean to only send header of the request ; 'range' http range header
         */
        public static function get($dir, $files, $params = null) {
+               sleep(5);
                $view = \OC\Files\Filesystem::getView();
                $getType = self::FILE;
                $filename = $dir;

then if the first video doesn't stall, try with the second one.

the key is to make sure that some future video is being loaded in the network console (pending) while you are triggering the playback of the first.

image

PVince81 avatar Feb 13 '19 11:02 PVince81

suggestion: if the video player has an event that signals that playback has started, use that one to clear the spinner

PVince81 avatar Feb 13 '19 11:02 PVince81

doesn't seem to happen any more with 1.0.0RC1

PVince81 avatar Apr 15 '19 16:04 PVince81

hmm still happening but without the above error.

I had to wait a long time for the first video in the list to load while the preload was busy with the other videos. Then when the video finally appeared, the spinner was still there while the video was playing. Reopening.

PVince81 avatar Apr 15 '19 16:04 PVince81