
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@pdftron/media-sample-server
Advanced tools
This is a demo server to use with @pdftron/webviewer-video and @pdftron/webviewer-audio
Sample server for below WebViewer add-ons:
The Media Sample Server allows for utilization of ffmpeg commands in conjunction with WebViewer to allow for greater functionality. Currently redaction of audio and video frames are supported.
Before you begin, make sure your development environment includes Node.js, npm and ffmpeg.
If you wish to use s3 with your server, make sure to update the aws_key and aws_secret values in the config.json.
npm i - Installs the pre-requisites required to run the servernode ./index.js - Starts the local dev serverBelow is an example of how to use the server with WebViewer Video. Sample code of how WebViewer-Video could be integrated into your application can be found here.
For further information on integrating the server with your application, please check this link or link.
import WebViewer from '@pdftron/webviewer';
import { initializeVideoViewer } from '@pdftron/webviewer-video';
WebViewer({
path: '/webviewer/lib',
enableRedaction: true,
},
viewer.current,
).then(async instance => {
// Extends WebViewer to allow loading HTML5 videos (.mp4, ogg, webm).
const {
UI,
loadVideo,
} = await initializeVideoViewer(
instance,
{
license: '---- Insert commercial license key here after purchase ----',
enableRedaction: true,
}
);
// 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')
let currentVideoUrl = 'https://pdftron.s3.amazonaws.com/downloads/pl/video/video.mp4';
loadVideo(currentVideoUrl);
UI.updateElement('redactApplyButton', {
onClick: async redactAnnotations => {
const response = await fetch('http://localhost:3001/video/redact', {
method: 'POST',
body: JSON.stringify({
intervals: redactAnnotations.map(annotation => ({
start: annotation.startTime,
end: annotation.endTime,
shouldRedactAudio: annotation.shouldRedactAudio || annotation.redactionType === 'audioRedaction',
shouldRedactVideo: annotation.redactionType !== 'audioRedaction',
})),
url: currentVideoUrl,
}),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
});
const videoBuffer = await response.arrayBuffer();
currentVideoUrl = await response.text();
videoInstance.loadVideo(currentVideoUrl);
return currentVideoUrl;
}
});
});
FAQs
This is a demo server to use with @pdftron/webviewer-video and @pdftron/webviewer-audio
The npm package @pdftron/media-sample-server receives a total of 7 weekly downloads. As such, @pdftron/media-sample-server popularity was classified as not popular.
We found that @pdftron/media-sample-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.