Some test text!

Loading...
Guides
Adapative Streaming

Adaptive Streaming

WebViewer Video utilizes Shaka Player to allow for adaptive streaming. In order to utilize adaptive streaming, a dash file must be passed when loading the video. Adaptive streaming allows users to load lower resolution videos on slower networks.

What is Adaptive Streaming

Adaptive streaming is a streaming technique that takes into account the user's network and CPU usage to determine the optimal quality of media to pass through to the end user. This allows WebViewer Video to work more effectively on lower end computers/networks, and can also react to any network latency issues that may arise while using WebViewer Video.

Creating a Dash File

Please see here on how to create a dash file to pass to WebViewer Video. In order to create a DASH file you must have multiple videos with different resolutions and link them in a manifest file. After you can simply pass the file as you would pass any video file to WebViewer Video.

import WebViewer from '@pdftron/webviewer';
import { initializeVideoViewer, renderControlsToDOM } from '@pdftron/webviewer-video';

WebViewer({
    path: '/webviewer/lib',
  },
  viewer.current,
).then(async instance => {
  // Extends WebViewer to allow loading HTML5 videos (.mp4, ogg, webm).
  const {
      getVideo,
      loadVideo,
  } = await initializeVideoViewer(
      instance,
      {
        license: '---- Insert commercial license key here after purchase ----',
        `---- Other settings ----`,
      }
  );
  // Load a video at a specific url. Can be a local or public link
  // If local it needs to be relative to lib/ui/index.html.
  // Or at the root. (eg '/video.mp4')

  // Dash file url
  const videoUrl = 'https://dash.akamaized.net/dash264/TestCasesHD/2b/qualcomm/1/MultiResMPEG2.mpd';
  loadVideo(videoUrl);
});

Get the answers you need: Support

Upcoming Webinar: How Developers Add Office Viewing Without Downloading | June 9th at 11 am PT

PDFTron SDK

The Platform

NEW

© 2022 PDFTron Systems Inc. All rights reserved.

Privacy

Terms of Use