Skip to content

Commit

Permalink
Tweak YouTube default playerVars
Browse files Browse the repository at this point in the history
playsinline: support playing inline in iOS webviews
rel: disable related videos appearing when video ends
iv_load_policy: disable annotations
origin: extra security measure
  • Loading branch information
cookpete committed Feb 2, 2016
1 parent ab2f8c2 commit b99e6d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const BLANK_VIDEO_URL = 'https://www.youtube.com/watch?v=GlCmAC4MHek'
const DEFAULT_PLAYER_VARS = {
autoplay: 0,
controls: 0,
showinfo: 0
playsinline: 1,
showinfo: 0,
rel: 0,
iv_load_policy: 3
}

let playerIdCount = 0
Expand Down Expand Up @@ -68,7 +71,8 @@ export default class YouTube extends Base {
playerVars: {
...DEFAULT_PLAYER_VARS,
...this.props.youtubeConfig.playerVars,
start: parseStartTime(url)
start: parseStartTime(url),
origin: window.location.origin
},
events: {
onReady: () => {
Expand Down

0 comments on commit b99e6d9

Please sign in to comment.