Title: Live Notification
Last modified: April 5, 2020

---

# Live Notification

 *  Resolved [ryankline](https://wordpress.org/support/users/ryankline/)
 * (@ryankline)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/live-notification/)
 * Is it possible to have a notification in menu or widget area that shows live/
   offline status for this plugin?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [macbookandrew](https://wordpress.org/support/users/macbookandrew/)
 * (@macbookandrew)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/live-notification/#post-12645703)
 * Yes, but it would take a bit of custom code.
 * When a live stream is loaded, the `wpYouTubeLiveStarted` event is fired; you 
   can use this javascript code to create custom front-end features on your site
   by adding an event listener:
 *     ```
       window.addEventListener('wpYouTubeLiveStarted', function() {
           /* your code here */
           console.log('stream started');
           /* your code here */
       });
       ```
   
 * You’d have to include the `[youtube_live fallback_behavior="no_message"]` shortcode
   in a widget or footer so it would be running on every page.
    -  This reply was modified 6 years, 4 months ago by [macbookandrew](https://wordpress.org/support/users/macbookandrew/).
      Reason: tweak code formatting
 *  Thread Starter [ryankline](https://wordpress.org/support/users/ryankline/)
 * (@ryankline)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/live-notification/#post-12667728)
 * What code would need to be added this where the commented out code is? Meaning,
   if I have a true false question “Is stream live?” If yes, display “LIVE”. If 
   no, display “OFFLINE”. Not sure I follow how my description would be included
   in your code above.
 *  Plugin Author [macbookandrew](https://wordpress.org/support/users/macbookandrew/)
 * (@macbookandrew)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/live-notification/#post-12669666)
 * It depends on your theme or widget. If I were to build it, I would:
    1. Add this to your theme’s javascript file
    2. Add a menu item or widget with two `<span>`s or `<div>`s, one for “offline” 
       and one for “live”
    3. On pageload, hide the “live” one
    4. The snippet above will run when a video starts, so in that snippet, hide the“
       offline” and display the “live” one
 * Sorry, it’s not particularly user-friendly if you’re not comfortable with a bit
   of coding.
 *  Plugin Author [macbookandrew](https://wordpress.org/support/users/macbookandrew/)
 * (@macbookandrew)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/live-notification/#post-12675457)
 * I’ll look at adding a `[youtube_live_indicator]` shortcode you could place in
   a menu or widget to show an indicator as described—that seems generally useful
   to a lot of people.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Live Notification’ is closed to new replies.

 * ![](https://ps.w.org/wp-youtube-live/assets/icon-256x256.png?rev=2711798)
 * [WP YouTube Live](https://wordpress.org/plugins/wp-youtube-live/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-youtube-live/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-youtube-live/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-youtube-live/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-youtube-live/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-youtube-live/reviews/)

## Tags

 * [alert](https://wordpress.org/support/topic-tag/alert/)
 * [status](https://wordpress.org/support/topic-tag/status/)

 * 4 replies
 * 2 participants
 * Last reply from: [macbookandrew](https://wordpress.org/support/users/macbookandrew/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/live-notification/#post-12675457)
 * Status: resolved