MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

MMM-iFrame-Ping



  • Hello,

    after struggling with existing iFrame modules, I decided to create my own…

    Here are some other iFrame module :

    The functionnalities of my new iFrame module :

    • Allow periodic refresh of the iFrame, or not (configurable), this allow to display images (with refresh) or video (without refresh)
    • Ping the URL before trying to display the content. Display an error (with the last successful PING date and time) if the host is not reachable. PING code from MMM-Ping by CFenner
    • If a PIR-sensor using MMM-PIR-Sensor module is used, the iFrame will not be updated during screen off (this behavior works also with all other module that send the notification “USER_PRESENCE”) and will be refresh with screen on.
    • If the iFrame-Ping module is hidden (by REMOTE-CONTROL or any Carousel module for example), the iFrame will not be updated. As soon as one MMM-iFrame-Ping module will be again displayed on the screen, an update will be requested.
    • Possibility to display the date and time of the last update request (configurable)
    • CSS file

    I tested it with MM² version 2.4.1.

    I hope it can also be helpful for others, please let me know any issue.

    Some screenshot :
    Display YouTube :
    0_1532871282781_MMM-iFrame-Ping_youtube_update.png

    Display camera snapshot (with updates) :
    0_1532871357269_MMM-iFrame-AgP.png

    PING Nok :
    0_1532871391253_MMM-iFrame-Ping_Nok_with update display.png

    PING Ok, iFrame upload on-going :
    0_1532871408913_MMM-iFrame-Ping_ok.png

    All infos and installation instruction :



  • This post is deleted!


  • @AgP42 Thank you for this version of iFrame. Works well for me 🙂
    I do get a white line around the embedded iFrame. Could you please tell me, how to get rid of it?



  • @rudibarani said in MMM-iFrame-Ping:

    @AgP42 Thank you for this version of iFrame. Works well for me 🙂
    I do get a white line around the embedded iFrame. Could you please tell me, how to get rid of it?

    Hello,

    you can try the following :

    On the file “MMM-iFrame-Ping.js”, on lines 135, 136 and 137 there is :

    iframe.width = this.config.width;
    iframe.height = this.config.height;
    iframe.scrolling = this.config.scrolling;
    

    with those lines, please add :

    iframe.style = "border:0"
    

    This should solve your problem !

    Bye,
    AgP42



  • @agp42 Thanks for the quick help!



  • Dear @AgP42,
    one of my use cases for your module is showing a livestream from the ISS on the night-page of my mirror, if a user is present. Looks really good!
    Now i thought of enhancing it and playing some curated movies from the ISS during those moments, when it is not flying in daylight.

    Would it be possible / difficult to add a limited number of youtube links and either select one of them for playback via a notification or play them randomly?

    0_1543272443087_IMG_0553.jpeg