am 2bfbd1d7: am 7d4e6bbe: am 96ac360b: am 2881d6f3: am 9f88a60d: am 481f15c1: set youtube player lang based on user pref and enable captions when not English

* commit '2bfbd1d78089484be797cc6c6d2ee4fe93b05440':
  set youtube player lang based on user pref and enable captions when not English
This commit is contained in:
smain@google.com 2014-12-16 11:02:56 +00:00 committed by Android Git Automerger
commit d79a1e8ad2

View file

@ -595,6 +595,8 @@ function onYouTubeIframeAPIReady() {
function startYouTubePlayer(videoId) {
var idAndHash = videoId.split("#");
var startTime = 0;
var lang = getLangPref();
var captionsOn = lang == 'en' ? 0 : 1;
if (idAndHash.length > 1) {
startTime = idAndHash[1].split("t=")[1] != undefined ? idAndHash[1].split("t=")[1] : 0;
}
@ -603,7 +605,7 @@ function startYouTubePlayer(videoId) {
height: '529',
width: '940',
videoId: idAndHash[0],
playerVars: {start: startTime},
playerVars: {start: startTime, hl: lang, cc_load_policy: captionsOn},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange