Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Mode: video player does not allow Download #105

Open
kkalarickal opened this issue Mar 17, 2021 · 7 comments
Open

Offline Mode: video player does not allow Download #105

kkalarickal opened this issue Mar 17, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@kkalarickal
Copy link

Bug Description

Given a user who has stored the video for offline viewing
When the network connection is cut and the offline video is playing in the player
Then it is NOT possible to click the Download button within the video player to download the file to the machine

Expected Behaviour

If the offline behavior of the video player should match the behavior when the system is online, then the download button should work the same way. On the other hand, if downloads from offline IDB is NOT allowed, then we need to disable the download button or indicate this in a better way than a failed attempt.

Steps to reproduce

  1. Go to KINO Staging Site on Google Chrome
  2. Download one of the videos for offline viewing.
  3. Now break the internet connection to the device by switching off WiFi or going into Airplane mode without data connection
  4. Play the downloaded video
  5. You will notice that the video player has a option to download the video file on the far right hand side
  6. Click on download option in the video player interface
  7. The file does not download and there is a "Failed - Network Error" message.

Screenshots

Screen shot of failed download due to network error after clicking the download button from video player after cutting the connection -
image

Additional context

  • Project version: da8ec7d
  • Node version: n.a.
  • OS: Win10
  • Browser: chrome
  • Device: Galaxy S III

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@kkalarickal kkalarickal added the bug Something isn't working label Mar 17, 2021
@dero
Copy link
Collaborator

dero commented Mar 18, 2021

@kkalarickal Agreed, the Download button should work regardless of connection status. I believe you've encountered an unrelated issue that has been fixed in the latest batch of updates.

Can you please re-test?

I just checked that Download works in online and offline mode as expected.

@kkalarickal
Copy link
Author

@dero - I think the difference that I am seeing is because I actually cut off the network connection before trying to download the video from offline storage.

In general, there seems to be a difference between turning-a-service-worker to "Offline" in the DevTools > Applications tab and cutting off network connection by turning off the WiFi or data on a mobile.

For example, there is a "No Internet Connection" status message that appears when you turn service-worker offline
image

This does NOT appear when you cut network connection
image

@dero
Copy link
Collaborator

dero commented Mar 21, 2021

@kkalarickal Yes, cutting the connection is a case different from selecting "Offline" in the dev tools. From the MDN documentation about navigator.onLine:

So while you can assume that the browser is offline when it returns a false value, you cannot assume that a true value necessarily means that the browser can access the internet. You could be getting false positives, such as in cases where the computer is running a virtualization software that has virtual ethernet adapters that are always "connected."

We would need to employ a more reliable method of detecting when the client goes offline. I'm not sure if this should be a part of our Phase 1 efforts, though, because each possible approach is a non-trivial one.

Perhaps we should create a ticket to tackle this later? cc @jwold @derekherman

@derekherman
Copy link
Collaborator

Moving this issue into phase two or later sounds like the right thing to do here.

@kkalarickal
Copy link
Author

@jwold - Should tickets in QA column that are going to be addressed in phase two or later be moved back into Backlog ? Or is "Revisit Later" the correct column ?

@jwold
Copy link

jwold commented Mar 29, 2021

I'm not sure why that is happening, it may be part of prepping the release, but not sure.

@dero
Copy link
Collaborator

dero commented Oct 7, 2021

I've re-tested the issue here and I now believe fixing it would be a significant lift that is unlikely to be worth the effort.

  • The "Download" button is a part of the <video> element UI rendered by the browser. It is only displayed when a single static video file is played, it's not displayed when video is streamed using MSE.
  • In other browsers, e.g. Firefox, the same function can be accessed by right clicking the video and selecting "Save video as...".
  • There is no event I know of we could tap into in order to handle the download request ourselves.
  • We would likely need to build our own UI to allow users to download a video file in all contexts in a way that we could control.
  • We already have offline mode support, so it's debatable whether we even want to allow users to download video files from the application instead of just using the inbuilt offline support.

I'd actually suggest we add a controlslist="nodownload" attribute to all <video> elements and suppress the native UI Download button in browsers that support controlslist.

@derekherman, what do you reckon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants