I started a stream and left it LIVE for probably 15-20 minutes (I had to manually refresh the webpage for the viewer to become visible). After I stopped the LIVE stream the player that is displayed on the webpage will keep replaying the last 20 seconds of LIVE video that was streamed. It will then show the “Grey YouTube Screen” for about 1 second with Message, LIVE VIDEO OFFLINE. That will display for 1-2 seconds and then it will go back to playing the last 20 seconds of the LIVE video feed. This has continued for 10+ minutes and still going. So my question is this:
1. At what point should the player go back to hidden state (not viewable in browser)?
I have added the following code to the wp-youtube-live/wp-youtube-live.php
add_filter( ‘wp_youtube_live_no_stream_available’, ‘my_ytl_custom_message’ );
function my_ytl_custom_message( $message ) {
$message = ‘<p>Please check below for the scheduled event times to be broadcasted LIVE on NorthpointChristian.TV. You may also subscribe to our YouTube channel to get notifications when we are LIVE. Subscribe today so that you never miss any of the action! Thanks again for support the Northpoint Christian Sports Network. <p>Subscribe to NCSN YouTube Channel.</p>
<p><button type=”button” class=”button” id=”check-again”>Check again</button><span class=”spinner” style=”display:none;”></span></p>’;
return $message;
}
add_filter( ‘wp_youtube_live_transient_timeout’, ‘my_ytl_custom_timeout’ );
function my_ytl_custom_timeout( $message ) {
return ’15’;
}
Question 1 (check again vs. refreshing the page): chances are that the multiple caches were still in effect (more info here about the levels of caching).
Question 2 (introductory video): For the intro video, you can copy the embed code from YouTube and add the loop=1
parameter. For example:
<iframe width="1280" height="720" src="https://www.youtube.com/embed/EDyRZmU62MQ?autoplay=1&loop=1" frameborder="0" allowfullscreen></iframe>
Question 3 (end of video): currently, this plugin does not detect when a live video has finished, since I assumed that most people would simply close the page when the video is over. I may add that feature at some point.
-
This reply was modified 6 years, 8 months ago by macbookandrew. Reason: code formatting
Thanks Andrew! I found out that for the video loop to work you must also include &playlist=VIDEO_ID at the end 🙂
<iframe width=”1280″ height=”720″ src=”https://www.youtube.com/embed/EDyRZmU62MQ?autoplay=1&loop=1&playlist=EDyRZmU62MQ” frameborder=”0″ allowfullscreen></iframe>
I will test again on the auto loading when the Video Stream goes LIVE.
Andrew,
I am testing the LIVE Stream refreshing and it is still not working. Prior to testing this I clicked on CASHING > PURGE ALL in WordPress. The live stream is embeded here:
http://northpointchristian.tv/index.php/sample-page/
But after 7 minutes it has never refreshed to show the LIVE stream. It is showing the message that I edited in the PHP file and the embeded looping video. But it has yet to refresh and show the LIVE video.
Any ideas on what I should check to fix this?
—————————————————
2. I can click on “Check Again” and it will then populate the LIVE video feed. However it still leaves the text and embedded video from this code:
add_filter( ‘wp_youtube_live_no_stream_available’, ‘my_ytl_custom_message’ );
function my_ytl_custom_message( $message ) {
$message = ‘<p>Please check below for the scheduled event times to be broadcasted LIVE on NorthpointChristian.TV. You may also subscribe to our YouTube channel to get notifications when we are LIVE. Subscribe today so that you never miss any of the action! Thanks again for support the Northpoint Christian Sports Network. <p>Subscribe to NCSN YouTube Channel.</p>
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/%5BVIDEO_ID%5Dautoplay=1&loop=1&playlist=%5BVIDEO_ID%5D” frameborder=”0″ allowfullscreen></iframe><p>
<p><button type=”button” class=”button” id=”check-again”>Check again</button><span class=”spinner” style=”display:none;”></span></p>’;
return $message;
}
-
This reply was modified 6 years, 8 months ago by timmydjr.
@timmydjr Sorry about the delayed response. Is this still happening? I just released a major update that should fix this.
Rather than including your message in a filter, you can now add it directly in the WP dashboard.
@timmydjr Any update on this?
Closing due to inactivity
I will check it out but I am sure it is fine. I just now saw your messsage regarding the updates. Sorry about that.