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 '7d4e6bbe83bb32f7d12cd8dc7deea318857967b7':
  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 03:53:57 +00:00 committed by Android Git Automerger
commit 2bfbd1d780

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