Sandbox Logo

MediaHelpers

A library used to retrieve video stream urls for use with the VideoPlayer class.

How to use



Add the following package to your game/addon: carsonk.mediahelpers

Make sure your class is using MediaHelpers; and you're good to go!

Here's some example code:
public void PlayVideo(string url)
{
    if(MediaHelper.IsYoutubeUrl(url))
    {
        string streamUrl = MediaHelper.GetUrlFromYoutubeUrl(url);
        videoPlayer.Play(streamUrl);
    }
    else
    {
        videoPlayer.Play(url);
    }
}

Reviews

MediaHelpers

A library used to retrieve video stream urls for use with the VideoPlayer class.

Created
6/15/2023
Updated
8/26/2023
In Collections
Referenced By
Dependencies
Reviews