Play or Stream a Video with 3D audio in Unity

  Рет қаралды 24,467

samyam

samyam

Күн бұрын

Learn how to play or stream a video in unity on a 3D object using the VideoPlayer component. The VideoPlayer component can load a local file or use a HTTP url. For streaming, you cannot use KZfaq directly, but can host the video on a server or on Vimeo and get the link to the direct playback (I show to how in the video). Then we will implement 3D spatial sound, where the audio changes direction and volume depending on the user proximity to the video source.
ᐅGet the full Source Code Bundle to my Unity Tutorials 🤓
sam-yam.itch.io/samyam-full-s...
📥 Download the Source Code 📥
ᐅ / 72877383
📥 Get the Asset 📥
ᐅVR Cinema for Mobile: assetstore.unity.com/packages...
ᐅRumtime Transform Handler: assetstore.unity.com/packages...
Wishlist my new game BUMBI on Steam!
store.steampowered.com/app/28...
🤝 Support Me 🤝
Patreon: / samyg
Donate: ko-fi.com/samyam
►⏱️ Timestamps ⏱️
0:00 Intro
1:11 Video Player
3:42 Stream a Video
4:33 3D Sound
7:11 Outro
💖💖THANK YOU TO ALL MY PATRONS 💖💖
❯❯❯ My Links ❮❮❮
💗 Patreon 💗
/ samyg
💬 Discord Server 💬
/ discord
🐦 Twitter 🐦
/ samyam_utube
📚 Facebook 📚
/ samyam.youtube
🎵 Music 🎵
Ambient Gold
streambeats.com
👍 Like and Subscribe! 👍
🖥️ Computer Setup 🖥️
*As an Amazon Associate I earn from qualifying purchases.
www.amazon.com/shop/samyam
Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won't cost you any money, they will help me fund my development projects while recommending great assets!
#unity #gamedev #devlog

Пікірлер: 46
@samyam
@samyam 4 ай бұрын
Wishlist my new game BUMBI on Steam! store.steampowered.com/app/2862470/BUMBI/
@Kgotso_Koete
@Kgotso_Koete Жыл бұрын
Thank you so much for this tutorial. I just added the free cinema asset to my game and quickly got a video running thanks to you.
@justusforan
@justusforan Жыл бұрын
This has so many great applications, thanks for the video Sam!
@nicholasdavis9529
@nicholasdavis9529 Жыл бұрын
This is my favorite channel for game development. Thank you!
@ColeWithAGoal
@ColeWithAGoal Жыл бұрын
The VideoPlayer component is great :) Thanks for the tutorial!
@samyam
@samyam Жыл бұрын
Thanks for watching! 😄
@gazzer4461
@gazzer4461 Жыл бұрын
Thanks sam. That was awesome! I always wondered how that was done.
@GlasTaibhse
@GlasTaibhse Жыл бұрын
this is so cool! i've been planning a pretty big game for a while, and something like this would be perfect for the TV at the main characters house! this gives me something to look forward to for when i start making that project :) :) :)
@ayushsidam289
@ayushsidam289 Жыл бұрын
Thanks for the video miss Sam 🙂🙏🏻
@chriswatts3697
@chriswatts3697 Жыл бұрын
Maybe you`d like to enhance the scene with a illumination of the environment by the video. So the video would act as a lightsource and the room gets darker when the content in the video gets dark.
@RJ_93-t5f
@RJ_93-t5f Жыл бұрын
I Love You So much Sister. Thanx for making such useful videos, That help us lot.
@spyschannel8000
@spyschannel8000 Жыл бұрын
nice tutorial
@GemTappX
@GemTappX Жыл бұрын
Wow that's way easier then I thought.
@Rhodrzz
@Rhodrzz 2 ай бұрын
thx
@CarlosJustiniano
@CarlosJustiniano Жыл бұрын
Thanks!
@samyam
@samyam Жыл бұрын
Thank you so much for the donation!! 😄
@TheMeanArena
@TheMeanArena Жыл бұрын
Nice tutorial. I wonder if you can read and play movie files outside of the game build?
@zeroone8548
@zeroone8548 Жыл бұрын
​i would like to know about best methods of hosting videos , if we can use YT videos to play here. or do we actually have to code embedded video into the slot to play that ingame. is there any way that we can block YT player's sharing option so players dont find that its a YT video .
@anonymoussloth6687
@anonymoussloth6687 Жыл бұрын
How do we add buttons like play pause on the video screen?
@pramilayadav7810
@pramilayadav7810 Жыл бұрын
A game where you watch cinema will be very cool
@king_sharkey5768
@king_sharkey5768 7 ай бұрын
big screen
@tetvris
@tetvris Жыл бұрын
AVPro is best to add to VR Unity3D projects that need control of the video better.
@theguy9363
@theguy9363 Жыл бұрын
How's the video impacting performance?? Like when I'm looking at it directly, when I'm not looking but the video plays..
@vivekmusafir2304
@vivekmusafir2304 3 ай бұрын
Please make a video on how to use agora sdk for live video streaming
@user-es4fx7wo6r
@user-es4fx7wo6r 29 күн бұрын
@samyam Thx for guide. Greate video. Also have a quastion. Is there a way for Unitys Video Player to play some live streams from URL? mb not exactly twitch or youtube i wonder like in general is it possible? any option will be great. Not just video that can bedownloaded from internet, but literally the one which is currently Live. like make retranslation to my game.
@ROUGETHEBAT456
@ROUGETHEBAT456 Жыл бұрын
How do u play a video with sound in play mode
@SetsuneW
@SetsuneW Жыл бұрын
I don't see the Runtime Transform Handlers link in the description. I searched for it in the Unity Asset Store, but the closest was called Gizmos?
@samyam
@samyam Жыл бұрын
Oops! Just added to the description thanks!
@SOS_Studios
@SOS_Studios Жыл бұрын
when i make it 3d it doesn't play sound PLEASE HELP ):
@ricardomota3964
@ricardomota3964 4 ай бұрын
Does the video player stream from RTMP/RTSP streams?
@PhilM4
@PhilM4 10 ай бұрын
The vimeo portion doesn't seem to exist anymore. Please help.
@ElSolitarioPerpetuo
@ElSolitarioPerpetuo Жыл бұрын
I have a doubt, this works to live transmissions in vimeo?
@HassanKaraouni
@HassanKaraouni 11 ай бұрын
I'm interested in learning more about that too. Have you learned anything more about this?
@technofeeliak
@technofeeliak Жыл бұрын
Okay, imagine. I'm backing up 7,000 + DVDs and Blu ray on a PC I built. Now, picture this as a solution. Yeaaaaaaaaah! I hope those seat are comfy. Also, no crying kids or noisy adults allowed.
@Ramiro24-7
@Ramiro24-7 8 ай бұрын
How can I play a video with a click? Like a real TV, I want to turn on it with a click, have you got any script?
@jasonwilliams8730
@jasonwilliams8730 Жыл бұрын
👍
@ErenBR562
@ErenBR562 Жыл бұрын
Does it work with a youtube live URL? Is it URP compliant?
@HassanKaraouni
@HassanKaraouni 11 ай бұрын
I'm interested in learning more about that too. Have you learned anything more about this?
@igorandruchiw2022
@igorandruchiw2022 6 ай бұрын
Hello. Can you please help me? I'm doing the same as you in the video. In the video, there is a video stream on the screen and for some reason it does not render in 360. But in 2D everything is fine. What could it be? A link to what happens kzfaq.info/get/bejne/jrdlnrmikrK8dac.html
@technofeeliak
@technofeeliak Жыл бұрын
Seriously, you can use this to play a video before your game starts. Just like those old arcade Street Fighter setups. Um, I'll just point out that in a cinema you don't have "3D audio". It's not the further you get the quieter the film gets because you've got speakers along the walls. Good to know you can do this, but................ but. You know.
@technofeeliak
@technofeeliak Жыл бұрын
I'm sorry. There's no A-tatch. Puss on the chainwax didn't work and A-tatch won't catch on either.
@joan6946
@joan6946 11 ай бұрын
Vimeo is paid platform. Would not pay untill have a working test.
@samyam
@samyam 11 ай бұрын
Pretty sure you can upload a video on their free plan
@joan6946
@joan6946 11 ай бұрын
@@samyam I managed to upload on free plan. But i do not get any working link for my video. I have a checkmark that says only the owner can download. MY application needs to authentificate to be able to download the video. Did that too with vimeo application with a personal token, and video id. private IEnumerator GetVideoInfo() { string requestURL = VimeoAPIBaseURL + "videos/" + videoId; UnityWebRequest request = UnityWebRequest.Get(requestURL); request.SetRequestHeader("Authorization", "Bearer " + accessToken); yield return request.SendWebRequest(); if (request.result == UnityWebRequest.Result.Success) { string responseJson = request.downloadHandler.text; Debug.Log("Video Info Response: " + responseJson); // Parse the JSON data to get the video URLs string streamingURL = ParseVideoStreamingURL(responseJson); // Load the video into the Video Player videoPlayer.source = VideoSource.Url; videoPlayer.url = streamingURL; videoPlayer.Prepare(); videoPlayer.prepareCompleted += OnVideoPrepareCompleted; } else { Debug.LogError("Error retrieving video info: " + request.error); } } with this i get a big Json file, but for any link of vimeo in this json the player does not play. Only colors up the Video player. ( found acount, and video name ). Only work with videos like this : download.samplelib.com/mp4/sample-5s.mp4
@racerx1777
@racerx1777 6 ай бұрын
this fucking shit dont work with url
@ImJamieX
@ImJamieX Ай бұрын
url doesn't work proper in versions 2021+... switch to 2019.4.39 for decent url support
Unity Architecture for Noobs - Game Structure
16:24
Tarodev
Рет қаралды 190 М.
The Power of Scriptable Objects as Middle-Men
17:41
samyam
Рет қаралды 120 М.
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 29 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 60 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 9 МЛН
How to: Dynamic Scroll View in Unity
12:42
samyam
Рет қаралды 33 М.
Change cursor on hover unity tutorial
2:08
Muhammad Shahzaib
Рет қаралды 434
The comments on my game were interesting....
9:00
samyam
Рет қаралды 17 М.
Device Camera - How to - Unity 3D [Tutorial]
14:11
N3K EN
Рет қаралды 188 М.
10 Things You NEED to Be Doing in Unity
11:40
Tarodev
Рет қаралды 128 М.
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 3,5 МЛН
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 8 МЛН
Худшие кожаные чехлы для iPhone
1:00
Rozetked
Рет қаралды 1,7 МЛН