In this episode, we work on generating a shareable link for a video—so you can easily share your content with others via a URL. The main focus is creating a dedicated, public-facing page that shows the video without requiring a user to sign in. We'll walk through setting up a new controller just for viewing the video, updating our routes (making sure it sits outside any authentication middleware), and using the video UUID so each link is unique and secure.
Once we've got our controller and route sorted, we update our API resource to generate the share URL and display it on the page. For better user experience, we set up an input filled with the share URL that's styled to match the rest of our app. You can simply click the input to select the whole link and copy it—super handy!
Next, we build out the actual share page. Instead of using the authenticated layout (since we want this public), we tweak our guest layout to make the video look nice at a bigger size. We pass in video data as props, display the video player, title, and description. The page is styled to be clean and you don’t have to log in to view it.
By the end of this episode, you've got a full flow for sharing videos: grab the link, send it to anyone, and they can watch your video right away on a simple, branded, public page.