{"id":17397,"library":"videojs-swf","title":"Video.js Flash Fallback SWF","description":"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.","status":"abandoned","version":"5.4.2","language":"javascript","source_language":"en","source_url":"https://github.com/videojs/video-js-swf","tags":["javascript","flash","video","player"],"install":[{"cmd":"npm install videojs-swf","lang":"bash","label":"npm"},{"cmd":"yarn add videojs-swf","lang":"bash","label":"yarn"},{"cmd":"pnpm add videojs-swf","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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.","symbol":"video-js.swf","correct":"(No direct JS import; asset is referenced via Video.js options)"},{"note":"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.","wrong":"import 'videojs-swf'","symbol":"Flash Tech Configuration (Legacy)","correct":"videojs('my-video', { techOrder: ['flash', 'html5'], flash: { swf: '/path/to/video-js.swf' } });"}],"quickstart":{"code":"<!DOCTYPE html>\n<html>\n<head>\n  <title>Video.js Flash Fallback Example</title>\n  <link href=\"https://vjs.zencdn.net/5.10.8/video-js.css\" rel=\"stylesheet\">\n  <script src=\"https://vjs.zencdn.net/5.10.8/video.js\"></script>\n  <style>\n    body { font-family: sans-serif; }\n    .video-container { width: 640px; margin: 20px auto; }\n  </style>\n</head>\n<body>\n  <div class=\"video-container\">\n    <h1>Video.js with Flash Fallback (Legacy)</h1>\n    <p>This example demonstrates how to configure Video.js v5.x to use a compiled Flash SWF for playback.\n    <b>Note: Flash Player is no longer supported by modern browsers. This demo will likely fail to play video.</b></p>\n    <video id=\"my-video\" class=\"video-js vjs-default-skin\" controls preload=\"auto\" width=\"640\" height=\"360\"\n      poster=\"https://vjs.zencdn.net/v/oceans.png\" data-setup=\"{}\">\n      <source src=\"https://vjs.zencdn.net/v/oceans.mp4\" type=\"video/mp4\">\n      <source src=\"https://vjs.zencdn.net/v/oceans.webm\" type=\"video/webm\">\n      <p class=\"vjs-no-js\">\n        To view this video please enable JavaScript, and consider upgrading to a web browser that\n        <a href=\"https://videojs.com/html5-video-support/\" target=\"_blank\">supports HTML5 video</a>\n      </p>\n    </video>\n  </div>\n\n  <script>\n    // Simulate having a locally built video-js.swf file\n    // In a real scenario, you would compile videojs-swf and place the output `video-js.swf`\n    // in a path accessible by your web server.\n    const swfPath = '/path/to/your/compiled/video-js.swf'; // REPLACE WITH ACTUAL PATH\n\n    videojs('my-video', {\n      techOrder: ['flash', 'html5'], // Prioritize Flash if available\n      flash: {\n        swf: swfPath // Point to the compiled SWF asset\n      }\n    }, function() {\n      console.log('Video.js player is ready (v5.10.8)');\n      console.log('Flash SWF path configured:', swfPath);\n      // The player will attempt to load the Flash tech if HTML5 fails or is not preferred.\n      // In modern browsers, this will almost certainly fail due to Flash EOL.\n    });\n  </script>\n</body>\n</html>\n","lang":"javascript","description":"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."},"warnings":[{"fix":"Migrate all video playback to HTML5. Ensure all video sources are provided in HTML5 compatible formats (MP4, WebM, Ogg).","message":"Adobe 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.","severity":"breaking","affected_versions":"all"},{"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.","message":"This `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.","severity":"breaking","affected_versions":">=6.0.0"},{"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.","message":"Building 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Avoid using Flash Player in any production environment. Prioritize HTML5-based solutions for video playback.","message":"Using 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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"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.","cause":"The web browser has deprecated, blocked, or completely removed support for Adobe Flash Player, or the plugin is not installed/enabled.","error":"Error: Flash is not supported or not installed."},{"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.","cause":"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.","error":"Failed to load resource: the server responded with a status of 404 (Not Found) - /path/to/video-js.swf"},{"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).","cause":"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.","error":"TypeError: Cannot read properties of undefined (reading 'swf')"}],"ecosystem":"npm","meta_description":null}