MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Autoplaying videos with MMM-iFrame-Ping

    Scheduled Pinned Locked Moved Entertainment
    4 Posts 2 Posters 1.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      JoeRonimo
      last edited by

      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?

      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @JoeRonimo
        last edited by

        @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.  <-------
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          JoeRonimo @sdetweil
          last edited by JoeRonimo

          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?

          S 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @JoeRonimo
            last edited by

            @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.

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy