0

I am trying to play .swf file using Videojs but getting message that media could not be loaded either the server or network failed or because the format is not supported. Here is my code:

    <link href="/html/js/video/videojs/video-js-5.17.0/video-js.css" rel="stylesheet">
<script type="text/javascript" src="/html/js/video/videojs/video-js-5.17.0/video.min.js"></script>
<script>videojs.options.flash.swf = "/html/js/vendor/video-js-swf-5.3.0/dist/video-js.swf"</script>

<div style="display:block; margin-top: [[margin_top]]px; color: #fff; border:none;">
    <video id="vidojs-player-swf"
           class="video-js vjs-default-skin vjs-big-play-centered"
           controls
           preload="auto"
           width="[[width]]"
           height="[[height]]"
           data-setup="{}">
        <source src="/path/to/swf/file" type="video/x-flv"></source>

        <p class="vjs-no-js">
            To view this video please enable JavaScript, and consider upgrading to a
            web browser that
            <a href="http://videojs.com/html5-video-support/" target="_blank">
                supports HTML5 video
            </a>
        </p>
    </video>
</div>
user3653796
  • 158
  • 5
  • The format is not supported because SWF is not a video format. In some rare cases a SWF may contain some embedded video data but that's not the same thing. – misterben Feb 24 '17 at 16:35
  • I know swf format is not supported but during my research I found that there are plugins which canhelp play .swf like video-js-swf (https://github.com/videojs/video-js-swf). I downloaded and added the project in my project and specifying the path foe video-js.swf. Is there anything else I need to do?? – user3653796 Feb 24 '17 at 17:53
  • That is not a plugin for playing SWF files. It is Video.js's component that plays video formats such as FLV and MP4 in Flash. – misterben Feb 24 '17 at 18:05
  • Well I agree with you as their documentation doesnot say anything about playing .swf but I checked this http://stackoverflow.com/questions/16294832/how-do-i-play-a-swf-file-using-video-js and as per them it is possible. – user3653796 Feb 24 '17 at 18:16

0 Answers0