Some test text!
Web / Guides / Get Started
Collaborate and review videos frame by frame. WebViewer video allows users to annotate video frames, comment on frames, collaborate and review videos.
Annotations will be tied to specific frames and will only be rendered, when the video is seeked to the specific frames. This guide will show you how to get started with a free trial.
The source code for this project is available in our Git repo.
Prior to starting, you should have already installed Node and npm.
Get your Apryse trial key.
Apryse collects some data regarding your usage of the SDK for product improvement.
If you wish to continue without data collection, contact us and we will email you a no-tracking trial key for you to get started.
Clone the repo to a specific directory and then navigate to it:
# command line
git clone https://github.com/ApryseSDK/webviewer-video-sample.git video
cd video
video
directory and install the required dependencies to run the samples by executing:npm install
npm start
http://localhost:3000/
and you will see the sample WebViewer running with a video, similar to above.HTML5 Videos can be loaded into WebViewer with use of the @pdftron/webviewer-video package.
npm install @pdftron/webviewer-video
Below is a sample setup of the video package with webviewer.
initializeVideoViewer
is called to give WebViewer the ability to handle the loading of video files. Afterwards, a video can be loaded with loadVideo
. Lastly settings to customize the behavior of the controls can be passed in when calling initializeVideoViewer
.
import WebViewer from '@pdftron/webviewer';
import { initializeVideoViewer, renderControlsToDOM } from '@pdftron/webviewer-video';
WebViewer({
path: '/webviewer/lib',
selectAnnotationOnCreation: true,
},
viewer.current,
).then(async instance => {
// Extends WebViewer to allow loading HTML5 videos (.mp4, ogg, webm).
const {
loadVideo,
} = await initializeVideoViewer(
instance,
{
license: '---- Insert commercial license key here after purchase ----',
}
);
// 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')
const videoUrl = 'https://pdftron.s3.amazonaws.com/downloads/pl/video/video.mp4';
loadVideo(videoUrl);
});
Importing and exporting annotations works the exact same way as it does on WebViewer, with the video annotations having additional the properties start-time
and end-time
.
Make sure your server has byte-range requests enabled to allow video streaming.
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales