Registry / videojs-swf

videojs-swf

JSON →
library5.4.2jsnpmunverified

videojs-swf is a legacy package that provides a compiled Flash (SWF) video player, designed to serve as a fallback technology for Video.js versions 5.x and below. In its era, it enabled Video.js to maintain a unified API, allowing its skins, plugins, and other features to function across both HTML5 and Flash environments, crucial for broader browser compatibility before HTML5 video was universally robust. The package, currently at version 5.4.2 (last updated in 2018), is essentially a build tool for a `.swf` asset rather than a directly importable JavaScript module. It has not seen active development in many years, aligning with the general end-of-life for Adobe Flash Player itself. For Video.js 6.x and above, the Flash tech was moved to a separate `videojs-flash` repository, though both `videojs-swf` and `videojs-flash` are now largely obsolete due to browser Flash EOL.

npm install videojs-swf
INSTALL
IMPORT
SIG · VIDEOJS-SWF
V
videojs-swf
javascriptv5.4.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

video-js.swf
(No direct JS import; asset is referenced via Video.js options)
This package primarily produces a compiled `video-js.swf` file, not a JavaScript module. It is not imported using `import` or `require`. Instead, the SWF file is served as a static asset, and Video.js (v5.x and below) is configured to use it as a fallback technology. Modern browsers no longer support Flash.
Flash Tech Configuration (Legacy)
videojs('my-video', { techOrder: ['flash', 'html5'], flash: { swf: '/path/to/video-js.swf' } });
import 'videojs-swf'
To utilize the Flash fallback, the compiled `video-js.swf` must be accessible on your web server. Video.js is then initialized with `techOrder` including 'flash' and the `flash.swf` option pointing to the asset's URL. This approach is for older Video.js versions and is obsolete due to Flash EOL.

Demonstrates configuring Video.js (v5.x, using CDN link `https://vjs.zencdn.net/5.10.8/video.js`) to use a custom Flash SWF for video playback, highlighting the `techOrder` and `flash.swf` options. Crucially notes that Flash is EOL and this example is for historical context.

<!DOCTYPE html> <html> <head> <title>Video.js Flash Fallback Example</title> <link href="https://vjs.zencdn.net/5.10.8/video-js.css" rel="stylesheet"> <script src="https://vjs.zencdn.net/5.10.8/video.js"></script> <style> body { font-family: sans-serif; } .video-container { width: 640px; margin: 20px auto; } </style> </head> <body> <div class="video-container"> <h1>Video.js with Flash Fallback (Legacy)</h1> <p>This example demonstrates how to configure Video.js v5.x to use a compiled Flash SWF for playback. <b>Note: Flash Player is no longer supported by modern browsers. This demo will likely fail to play video.</b></p> <video id="my-video" class="video-js vjs-default-skin" controls preload="auto" width="640" height="360" poster="https://vjs.zencdn.net/v/oceans.png" data-setup="{}"> <source src="https://vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="https://vjs.zencdn.net/v/oceans.webm" type="video/webm"> <p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> </p> </video> </div> <script> // Simulate having a locally built video-js.swf file // In a real scenario, you would compile videojs-swf and place the output `video-js.swf` // in a path accessible by your web server. const swfPath = '/path/to/your/compiled/video-js.swf'; // REPLACE WITH ACTUAL PATH videojs('my-video', { techOrder: ['flash', 'html5'], // Prioritize Flash if available flash: { swf: swfPath // Point to the compiled SWF asset } }, function() { console.log('Video.js player is ready (v5.10.8)'); console.log('Flash SWF path configured:', swfPath); // The player will attempt to load the Flash tech if HTML5 fails or is not preferred. // In modern browsers, this will almost certainly fail due to Flash EOL. }); </script> </body> </html>
Debug
Known issues
breakingAdobe Flash Player reached End-of-Life (EOL) on December 31, 2020. All major web browsers (Chrome, Firefox, Safari, Edge) have since removed or blocked Flash support. This package and its compiled SWF are effectively unusable in modern web environments.
fix
Migrate all video playback to HTML5. Ensure all video sources are provided in HTML5 compatible formats (MP4, WebM, Ogg).
affects: all
breakingThis `videojs-swf` package is specifically for Video.js versions 5.x and below. It is incompatible with Video.js 6.x and newer, where the Flash tech was moved to a separate package (`videojs-flash`). Attempting to use this SWF with newer Video.js versions will lead to unexpected behavior or player failures.
fix
For Video.js 6.x+, if Flash was still a requirement (which it isn't now), you would have used `videojs-flash`. The general fix is to only use HTML5 video.
affects: >=6.0.0
gotchaBuilding the SWF requires the Adobe Flex SDK and specific configuration within its `flex-config.xml` file (e.g., `target-player` 10.3 and `swf-version` 12). Incorrect SDK setup or configuration can lead to compilation errors or an improperly built SWF.
fix
Ensure the `node_modules/flex-sdk/lib/flex_sdk/frameworks/flex-config.xml` file is correctly modified with `target-player` and `swf-version` as specified in the build instructions.
affects: all
gotchaUsing Flash-based video playback, even if technically possible in niche environments, poses significant security risks due to Flash Player's EOL and lack of ongoing security updates. It is highly vulnerable to exploits.
fix
Avoid using Flash Player in any production environment. Prioritize HTML5-based solutions for video playback.
affects: all
Errors
Common errors & fixes
Error: Flash is not supported or not installed.
The web browser has deprecated, blocked, or completely removed support for Adobe Flash Player, or the plugin is not installed/enabled.
fix
Modern browsers do not support Flash. This error is expected. Transition all video content to HTML5 video formats and players. No fix for enabling Flash in modern browsers exists.
Failed to load resource: the server responded with a status of 404 (Not Found) - /path/to/video-js.swf
The `video-js.swf` file is not present at the specified path on the web server, or the path configured in Video.js options is incorrect.
fix
Verify that the compiled `video-js.swf` asset is deployed to the correct server path and that the `flash.swf` option in your Video.js initialization precisely matches this URL.
TypeError: Cannot read properties of undefined (reading 'swf')
This typically occurs if Video.js is an unsupported version (e.g., v6.x or newer) for `videojs-swf`, or if the 'flash' tech is not properly registered/recognized by the Video.js instance.
fix
Ensure you are using Video.js version 5.x or below if you intend to use `videojs-swf`. For Video.js 6.x+, the relevant package was `videojs-flash` (though also now obsolete).
Upgrade
Version history
5.4.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
videojs-swf — npm install videojs-swf · libregistry