Can I play video in Online/Offline Both? with WebViewer Video Player

Product:
WebViewer Video
Product Version:
4.35.7
Please give a brief summary of your issue:
(Think of this as an email subject)

Want to Play my online videos in WebViewer Video library and alos wants to give support to play it offline mode.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
How can I play my Video in offline mode in WebViewer Video Player?

Is there any way to play video offline ?

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Hello, Iā€™m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.



To play videos both online and offline using WebViewer Video, youā€™ll need to manage the video files differently for each scenario. WebViewer Video supports video playback and annotation capabilities, but handling offline playback requires additional steps beyond the standard online streaming approach.

Some things you can try:

  • For online playback, ensure your video files are hosted on a server and accessible via URL. You can use adaptive streaming with DASH files for a better experience on various network conditions.

  • For offline playback, you need to download the video files to the userā€™s device beforehand. Store these files locally, and then configure WebViewer Video to load these local files instead of streaming from a URL.

  • Implement a mechanism to check for network availability and switch between online and offline modes accordingly.




Here are some resources that might help you:

  • WebViewer Video Documentation - This page provides an overview of the video features and capabilities, including offline playback considerations.

  • Adaptive Streaming Guide - Learn how to use adaptive streaming for online video playback, which is beneficial in varying network conditions.

  • Video Annotation Features - Explore how to annotate videos, which can be useful for both online and offline scenarios.




Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Hello @dgosai,

Thank you for posting on our forum,

WebViewer Video does support offline play, provided the file is on the local device. This can be done by loading a local file into the loadVideo() API while offline.

For your convenience, you can find our guide on loading files into WebViewer Video here: https://docs.apryse.com/web/guides/get-started/manually-video#how-it-works

Hope this helps!

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.

1 Like

To make the video player switch between online and offline when the network comes and goes, you can сheck if there is a network available, and if there is, enable online mode, otherwise enable offline mode. To do this, use the WebViewer Video API.

if (navigator.onLine) {
  // Code to initialize online mode
  WebViewer(..., { url: 'online-video-url' });
} else {
  // Code for offline mode initialization
  WebViewer(..., { file: 'path/to/local/video' 
});
}

This is just an example. You need to adapt it to your needs and consider what will happen if something goes wrong.

2 Likes