Skip to content

CarsonKompon/sbox-mediahelpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbox-mediahelpers

A library used to retrieve media urls for the VideoPlayer class in S&box

Helpful Information

The Kick.com-related functions are currently not working as intended as they require a cloudflare bypass. I'm not sure I can natively build that in S&box so I am currently waiting for an official Kick.com API :)

How to use

  1. Add the package to your game/addon: image

  2. Make sure you're 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);
  }
}

Credit

Based on YoutubeExplode: https://github.com/Tyrrrz/YoutubeExplode

About

A library used to retrieve media urls for the VideoPlayer class

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages