In Post #2 of this topic, the playerVars/settings are not working.
In Post #4 of this topic, they are working.
The best I can do is this on Code 2
Without making lines longer than 80 characters long.
https://jsfiddle.net/nm3bhywL/
But it’s not working the same as Code 1
Post #4 Is how those playerVars/settings became working again in Code 1.
In Code 1
https://jsfiddle.net/pcgmvj7L/
The playerVars/settings per video are working.
managePlayer.addRandom(".playa", {
playerVars: {
start: 45
}
managePlayer.add(".playc", {
playerVars: {
start: 50
}
});
In Code 2, the code I edited, those are not working.
And before I started editing Code 2 those were working, you can see here.
https://jsfiddle.net/zy15rLap/
In Code 2 I edited,
https://jsfiddle.net/nm3bhywL/
I don’t know what would be adjusted in it, so that the playerVars/settings per video are working the same way as is working in Code 1.
https://jsfiddle.net/pcgmvj7L/
I don’t know why this it taking me so long to get working. Code 2 is not that much different from Code 1.
Investigating further:
Editing Code 2
Removing playerVars from settings.
const playerVars = settings/*.playerVars*/;
These are working.
https://jsfiddle.net/1Lk5eqvp/
managePlayer.addRandom(".playa", {
start: 45
}, [
managePlayer.add(".playc", {
start: 60
});
This is not working:
managePlayer.init({
playerVars: {
controls: 0,
fs: 0
}
});
What was removed:
const defaultOptions = defaults.playerOptions;
const defaultVars = defaultOptions.playerVars;
const playerVars = settings/*.playerVars*/;
const playerOptions = combinePlayerOptions(defaultOptions, settings);
playerOptions.playerVars = Object.assign({}, defaultVars, playerVars);
const player = new YT.Player(video, playerOptions);
players.push(player);
return player;
}
When this line is removed
/*playerOptions.playerVars = Object.assign({}, defaultVars, playerVars);*/
This is working:
https://jsfiddle.net/2mrzo3gy/
managePlayer.init({
playerVars: {
controls: 0,
fs: 0
}
});
These are not working.
managePlayer.addRandom(".playa", {
start: 45
}, [
managePlayer.add(".playc", {
start: 60
});
Line Removed:
const defaultOptions = defaults.playerOptions;
const defaultVars = defaultOptions.playerVars;
const playerVars = settings/*.playerVars*/;
const playerOptions = combinePlayerOptions(defaultOptions, settings);
/*playerOptions.playerVars = Object.assign({}, defaultVars, playerVars);*/
const player = new YT.Player(video, playerOptions);
players.push(player);
return player;
}
Are you able to figure out what the issue seems to be?
and how would that be fixed in the code so both are working?