How to redirect a video stream to another URL when it ends?

Hello,

How do I redirect a stream on my landing page to another URL when it ends?

Thank you.

Something like this might do the trick:

<script>
	const player = Stream(document.getElementById('stream-player'))
	player.addEventListener('ended', redirectFunction)

  function redirectFunction() {
      location.replace("https://community.cloudflare.com/");
   }
</script>

https://developers.cloudflare.com/stream/viewing-videos/using-the-player-api

1 Like

Thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.