• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 50.2k 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.
  • M Offline
    Mitchfarino Module Developer @bhepler
    last edited by Mitchfarino Oct 7, 2016, 1:48 PM Oct 7, 2016, 1:47 PM

    @bhepler What video did you use? Sorry I missed the link

    How did you rip it from YouTube?

    Y 1 Reply Last reply Oct 7, 2016, 1:58 PM Reply Quote 0
    • Y Offline
      yawns Moderator @Mitchfarino
      last edited by Oct 7, 2016, 1:58 PM

      @Mitchfarino
      check your chat ;)

      M 1 Reply Last reply Oct 7, 2016, 1:58 PM Reply Quote 0
      • M Offline
        Mitchfarino Module Developer @yawns
        last edited by Oct 7, 2016, 1:58 PM

        @yawns Awesome, thank you!

        1 Reply Last reply Reply Quote 0
        • M Offline
          Mitchfarino Module Developer @bhepler
          last edited by Oct 17, 2016, 9:32 PM

          @bhepler Is there a way to loop through a number of videos, rather than just the one on repeat?

          B 1 Reply Last reply Oct 18, 2016, 3:04 PM Reply Quote 0
          • B Offline
            bhepler Module Developer @Mitchfarino
            last edited by Oct 18, 2016, 3:04 PM

            @Mitchfarino Presumably you can inject some scripting to define an array of video files and then call a function to play the next file in the array. If you call that function from the onended() event in the VIDEO tag you should be able to get 90% of the way there.

            M 1 Reply Last reply Oct 27, 2016, 9:41 PM Reply Quote 0
            • M Offline
              Mitchfarino Module Developer @bhepler
              last edited by Oct 27, 2016, 9:41 PM

              @bhepler Any idea how to do that?

              B 1 Reply Last reply Oct 28, 2016, 2:27 AM Reply Quote 0
              • B Offline
                bhepler Module Developer @Mitchfarino
                last edited by Oct 28, 2016, 2:27 AM

                @Mitchfarino StackExchange had a pretty good start.

                Based upon the fact that the text value includes the HTML tag , you can probably put another tag in there to handle your script. Probably. I haven’t tried it. You may end up making some fancy character escaping in order to get it to work properly, but it should be possible. If I get the chance I’ll play with it.

                S 1 Reply Last reply Oct 28, 2016, 6:30 AM Reply Quote 0
                • S Offline
                  strawberry 3.141 Project Sponsor Module Developer @bhepler
                  last edited by strawberry 3.141 Oct 28, 2016, 6:32 AM Oct 28, 2016, 6:30 AM

                  @bhepler the problem is to get the script tag evaluated, when it gets inserted as text, i have a script that is working, but still stuck on the evaluation. It’s probably easier to just create a new module, than finding another hacky workaround

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

                  B 1 Reply Last reply Oct 28, 2016, 11:35 AM Reply Quote 0
                  • B Offline
                    bhepler Module Developer @strawberry 3.141
                    last edited by Oct 28, 2016, 11:35 AM

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

                    S 1 Reply Last reply Oct 28, 2016, 11:59 AM Reply Quote 0
                    • S Offline
                      strawberry 3.141 Project Sponsor Module Developer @bhepler
                      last edited by strawberry 3.141 Oct 28, 2016, 12:01 PM Oct 28, 2016, 11:59 AM

                      @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
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 3 / 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