JWPlayer - Shuffle/Repeat & Fullscreen/Autoplay

This thread may refer to an older version of JW Player! Check our articles for the most up-to-date information.
This Q&A thread was imported from our previous system and could apply to an older product.
  • I'm trying to do two things.

    1) Use jwplayer to pull from a playlist and shuffle all items in that playlist. Once all items have played, start over. When I set shuffle to 'true' what happens is it is too true of a shuffle. I've got 5 videos in there right now and it seems to play the same video twice in a row often. Also it will do something like: 1, 1, 3, 4, 1, 3, 3' and skip videos 2 and 5. Is it possible to force shuffle on the entire playlist and not repeat a video until all items in the playlist are complete? I've even see it do the same video 3 times in a row which is bad.

    2) How do you do a true fullscreen with autoplay command? The best I can figure is setting height and width to 100% but there's still a half inch border around the video with a white background.

    If I can get these two things fixed, the company I work for will probably buy a few hundred licenses over the next year. I just have to get it working is all. Also I assume once we buy licenses the "jwplayer" logo will no longer appear in the lower left corner when a video starts to play?

    Here's the code I'm using right now (shuffle is disabled because of the repeat video issue mentioned above)

    bc.. <script type='text/javascript'>
    jwplayer('mediaspace').setup({
    'flashplayer': '/jwplayer/player.swf',
    'playlistfile': 'rss.xml',
    'controlbar': 'none',
    'dock': 'false',
    'autostart': 'true',
    'icons': 'false',
    'width': '100%',
    'height': '100%',
    'repeat': 'always',
    'shuffle': 'false'
    });
    </script>

  • 1) It is not possible to only shuffle after the first time, it is either on or off.

    2) Because of a Flash security restriction, it is not possible to start the player in fullscreen mode I’m afraid.

     
    Up Down 0 rated
  • 1) Sad to hear that :(

    2) How does a website like fullscreentube.com work if flash has a security restriction?

    Up Down 0 rated
  • 1) Yeah, sorry.

    2) That is not full screen, that is just 100% width / height, just like this – http://developer.longtailvideo.com/player/trunk/fl5/js/test/examples/hundredpercent.html

     
    Up Down 0 rated
  • The link you posted has a white border around the video where the fullscreentube site doesn't.

    Up Down 0 rated
  • It’s just an example. True “fullscreen” mode is not possible at autostart in Flash, the site you posted was not using real fullscreen.

     
    Up Down 0 rated
  • Gotcha, I guess what I need to know is how do I remove the white border. I don't need true fullscreen I just want the border gone. Thanks for all your help.

    Up Down 0 rated
  • You can do this with CSS.

    Sample code:

    <html>
    <head>
    <title>100% by 100%</title>
    <style type="text/css">
    body {
    	margin: 0;
    	padding: 0;
    }
    #mediaspace {
    	margin: auto;
    	width: 100%;
    	height: 100%;
    }
    </style>
    </head>
    <body>
    <script type="text/javascript" src="http://player.longtailvideo.com/swfobject.js"></script>
    <div id='mediaspace'>This div will be replaced</div>
    <script type="text/javascript">
      var so = new SWFObject('http://player.longtailvideo.com/player.swf','mpl','100%','100%','9');
      so.addParam('allowscriptaccess','always');
      so.addParam('allowfullscreen','true');
      so.addVariable('file','http://www.longtailvideo.com/jw/upload/bunny.flv');
      so.addVariable('image','http://www.longtailvideo.com/jw/upload/bunny.jpg');
      so.addVariable('stretching','exactfit');
      so.write('mediaspace');
    </script>	
    </body>
    </html>
    
    

     
    Up Down 0 rated
  • Or with the embedder:

    <html>
    <head>
    <title>100% by 100%</title>
    <style type="text/css">
    body {
    	margin: 0;
    	padding: 0;
    }
    #medispace {
    	margin: auto;
    	width: 100%;
    	height: 100%;
    }
    </style>
    </head>
    <body>
    <script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js">
    </script>
    <div id='mediaspace'>
    This div will be replaced
    </div>
    <script type="text/javascript">
        jwplayer("mediaspace").setup({
                'file': "http://www.longtailvideo.com/jw/upload/bunny.mp4",
    			'image': "http://www.longtailvideo.com/jw/upload/bunny.jpg",
                'flashplayer': "http://player.longtailvideo.com/player.swf",
                'width': "100%",
    			'height': "100%",
                'stretching': 'exactfit',
    			'controlbar': 'bottom',
    			'skin': 'http://www.longtailvideo.com/files/skins/five/5/five/five.xml'
        });
    </script>	
    </body>
    </html>
    
    

     
    Up Down 0 rated
  • You're my hero :)

    Up Down 0 rated
  • Np :)

     
    Up Down 0 rated
  • here is an example that I use on my web site to achieve fullscreen
    using the event feature of the JWPlayer

    bc.. events:
    {
    onPlay: function () {$jw('div1').setFullscreen(true)},
    onPause: function() {$jw('div1').setFullscreen(false)},
    onComplete:function()
    {
    $jw('div1').setFullscreen(false),
    $jw('div1').setup(options)
    }
    },

    Up Down 0 rated
  • Do you have a link that does this? ;) I am curious to see.

     
    Up Down 0 rated
  • Yes.works quite well too

    The direct link is www.mirana.net/mediaZX.html

    Up Down 0 rated
  • Thanks

     
    Up Down 0 rated
  • yw

    email if you wish to see something new ;-)

    Up Down 0 rated
  • Sure

     
    Up Down 0 rated
  • This line doesnt work :(
    onPlay: function () {$jw('div1').setFullscreen(true)},

    Up Down 0 rated
  • Link?

     
    Up Down 0 rated
  • @Josue

    bc.. This line doesnt work :(
    onPlay: function () {$jw('div1').setFullscreen(true)},



    *You fail to provide a link indicating that it doesn't work. Hence making the statement without support/backup evidence losses its validity.*

    You have to remember that the post above is the example that I use on my web site.

    IF you by chance copied it and *did not change the id of the jwplayer ($jw)* then it is understandable that it will not work.

    The id given in the example posted isn't really needed *IF and only IF* you have one instance of the player which does *require an id in its instantiation* BUT references made to the player thereafter really do not require the id to be present thus you could leave it out and use instead
    bc.. $jw()



    I bet the error lies is at you end.

    Up Down 0 rated
  • A link would be helpful though.

     
    Up Down 0 rated
  • hi..
    i am using jwplayer
    when i play this code on mobile default browser then it is play on full screen.. but i want it is play only on that div.. how can we do this please help..

    i use this sript
    jwplayer("dvvdoHelp").setup({
    autostart: true,
    controlbar: "none",
    levels: [
    { file: source1 },
    { file: source2 }
    ],
    //flashplayer: "jwplayer/player.swf",
    volume: 80,
    width: 520,
    events: {
    onComplete: function () { }
    }
    });

    Up Down 0 rated
  • Which devices are you using? If you are using a phone it will always open in fullscreen due to the screen size.

     
    Up Down 0 rated
  • Thaanx for quick response..
    i use sony xperia s 256 but in mobile other then default browser like firefox it is working fine for me... is there anyway to play video on particular div. not on fullscreen..

    i am waiting for your valuable respons..
    Thanx.

    Up Down 0 rated
  • There is not. If you are using a phone with a smaller screen size than a tablet for example, the player will always render in full screen.

     
    Up Down 0 rated
  • ok.. thanx ...

    Up Down 0 rated
  • Np

     
    Up Down 0 rated
  • I am trying in use the above code for getting fullscreenautoplay. When I plugged in my video works great. But for some reason I can't get it to use the custom skin. What am I doing wrong? Here's the code:

    <html>
    <head>
    <title>100% by 100%</title>
    <style type="text/css">
    body {
    margin: 0;
    padding: 0;
    }
    #mediaspace {
    margin: auto;
    width: 100%;
    height: 100%;
    }
    </style>
    </head>
    <body>
    <script type="text/javascript" src="http://player.longtailvideo.com/swfobject.js"></script>
    <div id='mediaspace'>This div will be replaced</div>
    <script type="text/javascript">
    var so = new SWFObject('http://player.longtailvideo.com/player.swf','mpl','100%','100%','9');
    so.addParam('allowscriptaccess','always');
    so.addParam('allowfullscreen','true');
    so.addVariable('file','http://rarepearlsboutique.com/jwplayer/videos/PhotoStory1.mp4');
    so.addVariable('autostart','true');
    so.addVariable('skin','http://rarepearlsboutique.com/jwplayer/skins/moderngreen/moderngreen.zip');
    so.addVariable('stretching','exactfit');
    so.write('mediaspace');
    </script>
    </body>
    </html>

    Up Down 0 rated
  • fullscreenautoplay is not possible, Flash security does not allow this.

     
    Up Down 0 rated
  • Yes, I understand that Flash has a security feature that does not allow true fullscreenautoplay. The code you listed previously is a nice compromise. I am happy with it. My only problem is for some reason the custom skin I build doesn't display in the above code, although it works in everywhere else. I don't understand what I am doing wrong. Why isn't the skin compatible with the above code?

    Up Down 0 rated
  • Do you have a link that I can see?

     
    Up Down 0 rated
  • Oh. Sorry.

    http://rarepearlsboutique.com/Untitled-2.html

    Up Down 0 rated
  • You need a crossdomain.xml file here – http://rarepearlsboutique.com/crossdomain.xml

    More information – http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html

     
    Up Down 0 rated
  • Thank you. I read through and uploaded the least restrictive cross-domain-policy example possible (see below) but still no luck. What else am I doing wrong here?

    http://rarepearlsboutique.com/crossdomain.xml

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM
    "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" secure="false"/>
    <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
    </cross-domain-policy>

    Up Down 0 rated
  • Use this one:

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-access-from domain="*" />
    </cross-domain-policy>
    
    

     
    Up Down 0 rated
  • I'm OK now. Thanks.

    Up Down 0 rated
  • Np.

     
    Up Down 0 rated
  • I have trying to use event function "setFullscreen(state)"
    but for sorry; I found that: its just works with html5 mode as noted.
    is there any way to embed youtube video using html5 mode within jwplayer?
    Thank you very much and regards.

    Up Down 0 rated
  • YouTube HTML5 mode only works on devices, not browsers.

     
    Up Down 0 rated
  • Thanks for your help,
    but That mean I can use events function liek "setFullscreen(state)" and automatically will works fine of devices? thats because Iam -for sorry- useing emulators of Andriod and IOS for testing not hardware devices it self...

    Up Down 0 rated
  • Devices disable auto fullscreen mode…it only works in html5 mode in the browser…

     
    Up Down 0 rated
  • I get it, Thank you very much for help and regards...

    Up Down 0 rated
  • Np

     
    Up Down 0 rated

This QA is closed.

Still don't have JW Player? Get It Here