---
title: "MediaHelpers - s&box library"
description: "A library used to retrieve video stream urls for use with the VideoPlayer class."
canonical: "https://sbox.watch/libraries/carsonk/mediahelpers/"
generated_at: "2026-07-23T00:20:23.594Z"
---

# MediaHelpers

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

- Type: library
- Ident: carsonk.mediahelpers
- Creator: Carson Kompon
- Canonical: https://sbox.watch/libraries/carsonk/mediahelpers/
- Markdown: https://sbox.watch/libraries/carsonk/mediahelpers.md
- sbox.game: https://sbox.game/carsonk/mediahelpers/
- Generated: 2026-07-23T00:20:23.594Z

## Stats

- 24h momentum: +0
- Terry score: 79%
- Favorites: 15
- Upvotes: 10
- Downvotes: 0
- Updated: Aug 27, 2023
- Created: Jun 15, 2023
- Size: 73.3 KB
- Files: 7
- Tags: videoplayer, media, video, helper

## Description

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);
 }
}



## More by Carson Kompon

| Package | Ident | Players | Favorites | Upvotes | Score | Markdown |
| --- | --- | --- | --- | --- | --- | --- |
| Razor Panel Tooltips | carsonk.razor_tooltips | 0 | 6 | 5 | 50% | https://sbox.watch/libraries/carsonk/razor_tooltips.md |
| RichText Razor Panels | carsonk.richtextpanels | 0 | 3 | 4 | 60% | https://sbox.watch/libraries/carsonk/richtextpanels.md |
| Editor All Chat | carsonk.editor_all_chat | 0 | 2 | 6 | 69% | https://sbox.watch/libraries/carsonk/editor_all_chat.md |
| TikTokTTS | carsonk.tiktoktts | 0 | 1 | 4 | 60% | https://sbox.watch/libraries/carsonk/tiktoktts.md |
| SFXR | carsonk.sfxr | 0 | 1 | 2 | 43% | https://sbox.watch/libraries/carsonk/sfxr.md |
| Granular Pitch Audio Processor | carsonk.granularpitchprocessor | 0 | 1 | 0 | -- | https://sbox.watch/libraries/carsonk/granularpitchprocessor.md |
