Search code examples
javascripthtml5-videojwplayervimeo-apidailymotion-api

JW Player not playing DAILYMOTION and VIMEO video but YOUTUBE Video works perfectly fine


JW Player is playing YOUTUBE Video perfectly fine but not playing DAILYMOTION and VIMEO video, even its play button dont even proceeds with the video.

Simply copy paste the whole code in Body Tag and output is there.

Below is the code in which Youtube, Dailymotion and Vimeo video. Waiting for the response.

Thanking You,,,,, guys :)

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://jwpsrv.com/library/9ompKvFTEeKn+hIxOQulpA.js"></script>

    <h3>related</h3>
    <div id="related"></div>
    <h3>Youtube Video</h3>
    <div id="youtube_video"></div>
    <h3>Dailymotion Video</h3>
    <div id="dailymotion_video"></div>
    <h3>Vimeo Video</h3>
    <div id="vimeo_video"></div>

    <script type="text/javascript">
        $(document).ready(function() {
            jwplayer("related").setup({
                flashplayer: "http://static.electroteque.org/swf/jwplayer.flash.swf",
                width: 760,
                height: 350,
                primary: "flash",
                html5player: "jwplayer.api.html5.js",
                'playlist.position': 'right',
                'playlist.size': '250',
                listbar: {
                    position: 'right',
                    size: 250
                },
                playlist: [
                    { apitype: "dailymotion", provider: "http://static.electroteque.org/swf/dailymotion-2.0.swf", file: "http://www.dailymotion.com/video/x5q9zr.mp4" , title: "Big Buck Bunny", duration: "10:05"   },
                ],
                dailymotion: {
                    enableApiData: true
                }
            });

            jwplayer("youtube_video").setup({
                flashplayer: "http://static.electroteque.org/swf/jwplayer.flash.swf",
                width: 300,
                height: 150,
                primary: "flash",
                html5player: "jwplayer.api.html5.js",
                playlist: [
                    {
                        file: "http://www.youtube.com/watch?v=JYbiMJkpFXY", 
                        title: "Funny Cats Compilation", 
                    },
                ],
                tracks: [
                    {
                        file: "http://ghatasheh.com/alijw/carlin.srt", 
                        default: true
                    }
                ]
            });

            jwplayer("dailymotion_video").setup({
                flashplayer: "http://static.electroteque.org/swf/jwplayer.flash.swf",
                width: 300,
                height: 150,
                primary: "flash",
                html5player: "jwplayer.api.html5.js",
                playlist: [
                    {
                        apitype: "dailymotion", 
                        provider: "http://static.electroteque.org/swf/dailymotion-2.0.swf", 
                        file: "http://www.dailymotion.com/video/xzdk8v_wordpress-instalations_tech.mp4", 
                        title: "Big Buck Bunny", 
                    },
                ],
                dailymotion: {
                    enableApiData: true
                }
            });

            jwplayer("vimeo_video").setup({
                flashplayer: "http://static.electroteque.org/swf/jwplayer.flash.swf",
                width: 300,
                height: 150,
                primary: "flash",
                html5player: "jwplayer.api.html5.js",
                playlist: [
                    {
                        apitype: "vimeo", 
                        provider: "http://static.electroteque.org/swf/vimeo-2.0.swf", 
                        file: "vimeo.com/66349319.mp4", 
                        title: "Vimeo Video", 
                    },
                ],
                vimeo: {
                    enableApiData: true
                }
            });

        });
    </script>

Solution

  • No mystery there. JW Player supports YouTube videos, but does not support Dailymotion or Vimeo videos. To display those videos, you have to use their own player scripts, not JW Player.

    From the JW Player FAQ:

    JW Player supports playback of multiple media formats: video files, audio files, YouTube videos, RSS playlists and adaptive streams.

    That's it. Nothing else.

    I gather there are plugins available to make JW Player work with Dailymotion or Vimeo videos, but they're not part of the JW Player package, and are not supported. You would have to download and install these separately.