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.

    Halloween mirror ghouls anyone?

    Scheduled Pinned Locked Moved General Discussion
    56 Posts 18 Posters 56.6k Views 19 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.
    • bheplerB Offline
      bhepler Module Developer @strawberry 3.141
      last edited by

      @strawberry-3.141 You’re going to turn me into a Javascript developer with crazy talk like that.

      strawberry 3.141S 1 Reply Last reply Reply Quote 0
      • strawberry 3.141S Offline
        strawberry 3.141 Project Sponsor Module Developer @bhepler
        last edited by strawberry 3.141

        @bhepler that’s what i currently come up with

        {
            module: "helloworld",
            position: "fullscreen_below",
            config: {
                text: "<video id='halloween_player'></video><script>console.log('init'); var halloween_videos = ['http://techslides.com/demos/sample-videos/small.mp4', 'http://vo.fod4.com/v/9727363b6d/v1280-q2.mp4']; var halloween_index = 0; function playHalloweenVideos(){ console.log('play'); if(halloween_index >= halloween_videos.length){ halloween_index = 0; } var player = document.getElementById('halloween_player'); player.src = halloween_videos[halloween_index++]; player.addEventListener('ended', playHalloweenVideos); player.play(); } playHalloweenVideos();</script><img src='test.png' onload='console.log(\"test\"); eval(document.getElementById(\"halloween_player\").nextSibling.innerHTML); document.removeChild(this);'"
            }
        }
        

        but i’m not able to eval in my fake img tag, however if you enter this command in the electron console it works

        eval(document.getElementById("halloween_player").nextSibling.innerHTML);
        

        Please create a github issue if you need help, so I can keep track

        1 Reply Last reply Reply Quote 0
        • F Offline
          frog
          last edited by frog

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • F Offline
            frog
            last edited by frog

            I’m trying to loop a video using the following:

               {
               module: ‘helloworld’,
               position: ‘fullscreen_below’,
               config: {
                  text: “<video src=‘vendor/skelloop.mp4’ autoplay loop; position:absolute; top:100%;left:50%; height:200%’></video>”
                  }
               },
            

            but it just stops after the first run. I’m using the OMXplayer which I would have thought would have taken the loop parameter - but it seems it doesn’t. Anyone have an idea how I can fix this?

            bheplerB 1 Reply Last reply Reply Quote 0
            • bheplerB Offline
              bhepler Module Developer @frog
              last edited by bhepler

              @frog You seem to be missing the style='position... part.

              So:

              config: {
                    text: “<video src=‘vendor/skelloop.mp4’ autoplay loop style='position:absolute; top:100%;left:50%; height:200%’></video>”
                    }
              
              F 1 Reply Last reply Reply Quote 2
              • F Offline
                frog @bhepler
                last edited by

                @bhepler yup, that dit it. Thanks!

                1 Reply Last reply Reply Quote 1
                • N Offline
                  nuckinfutz
                  last edited by

                  is there a way to use a variable in the video file name? This is so close to what I want it hurts. What I want to do is play a random video from a specific location. I will be creating the videos so I will have complete control over the video naming and encoding.

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    makersworkbench
                    last edited by

                    Sorry for resurrecting an old thread, but I have been trying to figure this out on my own for over a week now. How would I use a PING (ultrasonic) sensor to trigger the mmm-podcast module to make the jump scare happen? Python I can write but I am a javascript noob, and that is why I am having issues here.

                    So basically I want the PING sensor to trigger and play the video file full screen with audio after it senses someone x-distance away for X number of seconds. Very bad psudo code below.

                    when distance from sensor = 24-inches for 10-seconds
                    play scare animation using mmm-podcast
                    return to MagicMirror screen
                    wait 60-seconds before arming ping sensor again

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      Bruno
                      last edited by

                      Guys,

                      How did you manage to play a local video on the Pi with this module?

                      I am trying to make the halloween ghoul video (maybe a little late). I can get some video to play if the video is online. But if the video is on a directory on my raspberry pi I can’t.

                      In this topic all the “text” tag on the helloworld is blank because it is html tag so it gets “interpreted” by my browsers. I’ll try to post my “text” tag in non-HTML way, so you guys can analyse it (I took off the “minor than” sign from the tags: video, src and /video)

                      Heres my config:

                      {
                                  module: "helloworld",
                                  position: "middle_center",
                                  config: {
                                      text: "video id=\"homevideo\" width=\"100%\" autoplay autobuffer> source src=\"http://clips.vorwaerts-gmbh.de/VfE_html5.mp4\" type=\"video/mp4\" /> /video>"
                                  }
                              },
                      
                      

                      Above is an example if a simples mp4 video online: http://clips.vorwaerts-gmbh.de/VfE_html5.mp4
                      How do I change to a local mp4 file in my Pi? I tryed src="/home/pi/path/to/my/file.mp4" but no success… any ideas?

                      Thanks

                      S Mykle1M 2 Replies Last reply Reply Quote 0
                      • S Offline
                        sdetweil @Bruno
                        last edited by

                        @Bruno said in Halloween mirror ghouls anyone?:

                        Guys,

                        How did you manage to play a local video on the Pi with this module?

                        I am trying to make the halloween ghoul video (maybe a little late). I can get some video to play if the video is online. But if the video is on a directory on my raspberry pi I can’t.

                        In this topic all the “text” tag on the helloworld is blank because it is html tag so it gets “interpreted” by my browsers. I’ll try to post my “text” tag in non-HTML way, so you guys can analyse it (I took off the “minor than” sign from the tags: video, src and /video)

                        Heres my config:

                        {
                                    module: "helloworld",
                                    position: "middle_center",
                                    config: {
                                        text: "video id=\"homevideo\" width=\"100%\" autoplay autobuffer> source src=\"http://clips.vorwaerts-gmbh.de/VfE_html5.mp4\" type=\"video/mp4\" /> /video>"
                                    }
                                },
                        
                        

                        Above is an example if a simples mp4 video online: http://clips.vorwaerts-gmbh.de/VfE_html5.mp4
                        How do I change to a local mp4 file in my Pi? I tryed src="/home/pi/path/to/my/file.mp4" but no success… any ideas?

                        Thanks

                        Path has got to be in the mm folder tree or linked to from there
                        /modules/module name/filename.mp4

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 4 / 6
                        • 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