0

I'm using JW Player and I want it to load a different video format depending on what browser the user is using. According to the documentation, "levels" should be the parameter to accomplish this.

This is my code:

<div id='mediaplayer'></div>

    <script type="text/javascript">
      jwplayer('mediaplayer').setup({
        flashplayer: "jwplayer/player.swf",
        id: 'playerID2',
        width: '640',
        height: '360',
        levels: [
            { file: "http://mydomain.com/video.flv" },
            { file: "http://mydomain.com/video.mp4" }
        ]
      });         
    </script>

With this code, it shows the player, but when I tap on it on a mobile device, nothing happens. In a regular browser, it plays the video correctly.

I want to use this in case the user is using a mobile device like the iPad or iPhone. In a regular browser (Firefox), if I don't use "levels" and just use the file: "http://mydomain.com/video.flv" parameter, it works perfectly. It doesn't work on iPad because it's an FLV, hence why I want to use "levels". And yes, I need to use the FLV version for regular browsers.

I've also tried using the parameter "modes", indicating a different file for each mode (html5 and flash), but in this case it doesn't even show the player.

Any ideas?

1 Answer 1

0

1st off iPad and iPhone do not natively support flv.

At this time JWPlayer does not support device specific detection out of the box.

Albert, if this is the same person, I thought you had solved this via longtail support site:

http://www.longtailvideo.com/support/forums/jw-player/servers-and-streaming/18043/pseudostreaming-and-html5-for-the-iphone-problem

In that example you could deliver flv for web and mp4 to HTML5 (non flash).

If you could just do it all with mp4 would be simpler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.