Hi @lmtruong1512
9aF8YPhEQgaHxr4hoZwG3w==
UsIoxcsDSgerPxuK2NZwIQ==
After analyzing the logs, these two BOT users did not successfully start audio, possibly due to the browser’s autoplay policy requiring user interaction.
You can listen for the auto-play-audio-failed
event.
If you’re using Puppeteer, consider adding the launch flag --autoplay-policy=no-user-gesture-required
.
opened 03:01PM - 22 Jan 21 UTC
closed 08:40AM - 24 Jul 22 UTC
unconfirmed
I'm trying to play spotify via puppeteer. Because Chromium seems to not like aud… io file, I use chrome.
In headful mode, everything work well, but when I switch to headless mode, the song doesn't play at all (as if I was using Chromium??).
I though headless would had the same feature than headfull. I also tested with Edge but same problem.
Here is my code
```
var puppeteer = require('puppeteer');
var util = require("./util.js");
async function initBrowser(){
let browser = await puppeteer.launch({
headless: false, //permet de voir
slowMo: 15,
executablePath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
//
//args: (url)?[ `--proxy-server=${url}`]:[]
});
return browser;
}
exports.main = async function(){
let browser = await initBrowser();
let webPage = await browser.newPage();
await webPage.goto("https://accounts.spotify.com/en/login/", { waitUntil: "load", timeout: 30000});
//login
await webPage.type('#login-username', 'LOGIN');
await webPage.type('#login-password', 'PSWD');
await webPage.click('#login-button');
await util.sleep(1000);
//music
await webPage.goto("https://open.spotify.com/artist/3nFkdlSjzX9mRTtwJOzDYB", { waitUntil: "load", timeout: 30000});
await util.sleep(2500);
await webPage.click('#onetrust-accept-btn-handler'); //accept cookie
await util.sleep(1000);
await webPage.click('div[data-testid="action-bar-row"] button[data-testid="play-button"]'); //click on play
await webPage.screenshot({ path: 'test.png' })
}
```
Am I really still using Chrome in headless mode?
Thanks
Vic
1 Like