Carson Kompon Carson Kompon Library update 3y ago

MediaHelpers

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

favorite15favorites
thumb_up10upvotes
hard_drive 0 MB folder 7 files build Engine v10 history Last update 1096d ago
open_in_new View on sbox.game

About This Package

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: 

Make sure your class is  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);
    }
}

Media (2)

MediaHelpers - Thumbnail 2
8,943
Total Users
16,773
Total Sessions
5.8 months
Total Playtime
Package ID: carsonk.mediahelpers
Created: 2023-06-15 14:05 UTC
Updated: 2023-08-26 22:31 UTC
Type: library
Public: Yes
Version: 36414
files: 7
Size: 0.1 MB
Engine Version: 10
Asset Version ID: 36414
Version Created: 2023-08-26 22:31 UTC
Hash: -7830996493832279045
Manifest: Open manifest
Project Template:
Cs Proj Name:
Summary: A library for retrieving media urls for the VideoPlayer class
Description: I'll write a description on how to use this in a bit
Public: true
Resources:
Code Package References:
new_releases Latest Update Aug 26, 2023
Updated HttpAsync function to be the new order
36414 Aug 26, 2023
Updated HttpAsync function to be the new order
24037 Jul 9, 2023
revert to monke
24030 Jul 9, 2023
Start of Soundcloud integration?
23502 Jul 6, 2023
Forgot www for youtube
23501 Jul 6, 2023
youtu.be and /shorts/ url support
23284 Jul 5, 2023
Fixed Duration
23245 Jul 5, 2023
Null duration fixes
23244 Jul 5, 2023
Minor Documentation on the player interface
23239 Jul 5, 2023
MediaHelper Pain Day! GetYoutubePlayerResponse is now GetYoutubePlayerResponseFromUrl and GetYoutubePlayerResponseFromId
19499 Jun 24, 2023
Changes on 2023-06-24