1

With IFrame API, whether a video is played with html5 container or flash container depends on a lot of factors. I'm wondering: is it possible to set some parameter or call a function to force the player to be flash(or html5)?

besides, rel=0 seems not work in Iframe API, when I set it to 0, the related videos are still shown, is there something wrong with my code? thanks!

  player = new YT.Player('player', {
      height: '300', //720
      width: '400', //1280
      videoId: 'S2Rgr6yuuXQ',  
      playerVars: { 'rel': 0 }, // or rel: 0, rel: '0', all don't work
      events: {
        'onReady': onPlayerReady,
        'onStateChange': onPlayerStateChange,
        'onError': onErrorDetected,
        'onPlaybackQualityChange': onQualityChange
        }
      });
user1769686
  • 505
  • 2
  • 10
  • 16

3 Answers3

1

I think that the iframe option does not include a parameter to select html5 or flash option , because the iframe API uses the best option automatically.

you can try to specify to use HTML5 if available:

Force HTML5 youtube video

YouTube video in HTML5

and you can use the SWFObject option to use only the flash player in the client (if the client supports flash ..)

Community
  • 1
  • 1
Matias Molinas
  • 2,246
  • 15
  • 11
1

Using playerVars: { html5: 1 } loads an iframe with a html5=1 attribute in the src, similar to Force HTML5 youtube video.

Community
  • 1
  • 1
Sander
  • 11
  • 1
0

Replace

playerVars: { 'rel': 0 }

with

playerVars: { 'rel': '0' }
Simon MᶜKenzie
  • 8,344
  • 13
  • 50
  • 77
Ivan
  • 11
  • 3