Read the statement by Michael Teeuw here.
Autoplaying videos with MMM-iFrame-Ping
-
I’ve heard that MagicMirror stopped autoplaying videos in the browser since about version 2.10. I would like to use the MMM-iFrame-Ping module to play news videos in the mornings at my MagicMirror. I also noticed that a lot of websites like CBSNews, NBCNews, CNN, and Haystack.tv stopped autoplaying videos when you go to their websites.
I don’t want to use a keyboard or mouse with my MM. Can anyone think of a way to script these sites to play their videos when the iFrame opens?
-
@joeronimo yes, in 2,10 I added the setting to electron to allow auto play
electron changed the setting again ,
from https://www.electronjs.org/docs/api/browser-window
u will have to edit the code
MagicMirror/js/electron.js
add to the webPreferences
darkTheme: true, webPreferences: { contextIsolation: true, nodeIntegration: false, zoomFactor: config.zoom },
autoplayPolicy: 'no-user-gesture-required',
but
autoplayPolicy String (optional) - Autoplay policy to apply to content in the window, can be no-user-gesture-required, user-gesture-required, document-user-activation-required. Defaults to no-user-gesture-required. <-------
-
Thank you for answering @sdetweil , unfortunately, that didn’t work. I tried it with several sites that have a video at the top of their page, but none of them autoplayed if they even loaded at all into the iFrame.
Anyway, this is what I put into my electron.js:
darkTheme: true, webPreferences: { autoplayPolicy: 'no-user-gesture-required', contextIsolation: true, nodeIntegration: false, zoomFactor: config.zoom },
Is there something else that I need to do? With so many websites turning autoplay off, do you think we can simulate a mouse-click event in the middle of the iFrame after the page loads by modifying the MMM-iFrame-Ping.js file?
-
@joeronimo i do not know… they have been increasing the controls here to stop autoplay, cause customers are screaming…
i still yell at my phone browser every day cause it plays something I don’t think it should.