No video

How to Play a Video in Unity WebGL (Simple)

  Рет қаралды 10,275

Max O'Didily

Max O'Didily

Күн бұрын

Пікірлер: 45
@milkandcookies9536
@milkandcookies9536 Жыл бұрын
this is the only video that works on KZbin! all the others rush through it, do some webhosting that requires additional setup. your tutorial is the only one that just works out of the box. Thanks, you have my eternal gratitude
@philipino99
@philipino99 Жыл бұрын
this worked!!!! oh my!!! unity dont make it clear how to do this. no one has made a clear guide where we can just play the video file from our project. i contemplated spending £150 for that plugin but then I find your video. you saved me so much money, thanks so much for making this free
@kfcispoison6713
@kfcispoison6713 Жыл бұрын
hold on. there is a unity plugin going for $150 for playing a video in webgl and my man just uploads how to do it for free and quickly. underated youtuber
@rayamc607
@rayamc607 11 ай бұрын
Excep this doesn't work on Safari or mobile :-(
@kfcispoison6713
@kfcispoison6713 11 ай бұрын
it worked fine on my android and my ipad...
@rayamc607
@rayamc607 11 ай бұрын
For me it depends on the browser. No good on Safari mac, or chrome on Android. Slow and jumpy on samsung browser. Fine on other desktop browser but it has to work on everything@@kfcispoison6713
@XxXGAMESTERxKCXxX
@XxXGAMESTERxKCXxX Жыл бұрын
I appreciate the video, It saves me ever having to buy an asset that costs hundreds of pounds when it only took a few lines of code. Thank You!
@kristaferaltergott
@kristaferaltergott 18 күн бұрын
Well done Max, thanks so much!
@abobaaboba5902
@abobaaboba5902 6 ай бұрын
Bro, please tell me what to do if I did everything like in your video, but I have a problem. when I click start the game, the video is not displayed, although it is inside the camera, but the video is displayed in the unity editor, what should I do bro??? unity version 2022 and project 2d
@zoggieUtube
@zoggieUtube 11 ай бұрын
I get this error when trying to access the video player from my phone. NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Everything works fine when viewing from my pc. any idea why i'm getting this error?
@kamo5543
@kamo5543 Жыл бұрын
excellent, works perfect, thanks!, by the way, in my case works in my unity 2022 version, in 2019 it wasn't .
@maxodidily
@maxodidily Жыл бұрын
Out of curiosity, which version of 2019 didn't it work in? I discovered how to do this in 2019.4.33f1 but haven't tried any earlier versions.
@ponysonic
@ponysonic Ай бұрын
whats the reason for the streaming assets folder and code snippet vs just using the render texture/vid player method with it set to play on awake?
@iDabbl
@iDabbl Ай бұрын
that doesn't work on webgl
@IsmoYliviiri
@IsmoYliviiri 4 ай бұрын
Colors changing little bit from video when adding to Unity, otherwise works even in mobile phone build. Just have to remember to add video to be mp4 not mvk or other video files, atleast form me in mvk not work with this.
@lkc101
@lkc101 3 ай бұрын
It works on PCs but not on mobile.... any ideas? It'd be crucial for it to work on mobile WebGL....
@nadiamarzuki4922
@nadiamarzuki4922 11 ай бұрын
Hey, im getting VideoPlayer does not contain definition of 'url'. :( following exactly as ur script. using 2022.3.10f1
@maxodidily
@maxodidily 11 ай бұрын
2 things jump to mind. Firstly, the VidPlayer script we make, don't call it VideoPlayer. Secondly make sure you import UnityEngine.Video;
@nadiamarzuki4922
@nadiamarzuki4922 10 ай бұрын
@@maxodidily hi thanks! damn missed that. im dumb :p. thanks alot about to try it out. you're a lifesaver.
@user-mp8ll3cw6e
@user-mp8ll3cw6e 5 ай бұрын
It's perfect solution
@vanessacmonteiro
@vanessacmonteiro 8 ай бұрын
Thanks for the great video! Do you have any showing how to add video to webGL that can be published? Or any tips on that? My video is hosted on AWS, but I can't find a way to make it work after publishing the game...
@maxodidily
@maxodidily 8 ай бұрын
What do you mean by doesn't work when published?
@kevienthursday1863
@kevienthursday1863 7 ай бұрын
目前我把网页部署在服务器上,但因为带宽限制,下载速度较慢,这就导致播放视频总是卡顿。卡顿可以理解,但是缓冲一段后,播放就像快进>>一样播放这段缓冲的视频,然后又卡顿。暂时还没有找到解决办法。
@user-jr7pj8or5y
@user-jr7pj8or5y Жыл бұрын
When I try to test webgl local, I only get video's sound without picture, I dont know why😭😭😭
@user-jr7pj8or5y
@user-jr7pj8or5y Жыл бұрын
I have solved this problem. Turn out the code format of the video is mp4v, so I is black screen. Using ffmpeg to change the code format to H264 would fix the problem. 😄
@maxodidily
@maxodidily Жыл бұрын
Sorry for the slow response! Glad to hear you solved the problem! docs.unity.cn/2023.2/Documentation/Manual/webgl-video.html This link is from Unity and provides more details on what formats are compatible with WebGL.
@kprogram8870
@kprogram8870 Жыл бұрын
The video you presented is to do it with a video that has already been prepared, and what I want is to print a video that shares the real-time screen on the UI. Is there a way?
@kevienthursday1863
@kevienthursday1863 7 ай бұрын
我有同样的困惑,目前我把网页部署在服务器上,但因为带宽限制,下载速度较慢,这就导致播放视频总是卡顿。卡顿可以理解,但是缓冲一段后,播放就像快进>>一样。暂时还没有找到解决办法。
@Rama142694
@Rama142694 Жыл бұрын
hey max! Nice video. i have a spritesheet map animation but its to heavy because the resolution is too high. I try to low the resolution but the spritesheet is still really heavy. I was thinking in render a video and use that instead with this approach you show. Do you think is a good idea or do you know a better way to do ir?
@maxodidily
@maxodidily Жыл бұрын
I think the video idea is worth trying. About a year ago I faced a similar issue. Hundreds of megabytes for a png sequence or 6mb for an MP4 video.
@Rama142694
@Rama142694 Жыл бұрын
@@maxodidily okay thank you very much! Will try with this video
@Keolamation
@Keolamation 7 ай бұрын
my video comes out black but, I can here audio. jfc
@user-qk6or9vx9h
@user-qk6or9vx9h Жыл бұрын
would you create a new for 2D game ? will this thing work in a 2D game developed in Unity
@maxodidily
@maxodidily Жыл бұрын
This can work in 2D games. Here is a tutorial on how to play a video on a UI canvas kzbin.info/www/bejne/o3quaniZrNx4g7s (Almost identical to what you do in this tutorial).
@zennycool
@zennycool Ай бұрын
after a lot of troubleshooting and it not working in the build. REMEMBER: make a clean build or it won't work!
@kprogram8870
@kprogram8870 Жыл бұрын
I'm sharing a screen on the web and I want to print this out on Unity 2D UI. Please teach me the way.
@maxodidily
@maxodidily Жыл бұрын
I have a tutorial on how to play a video on a UI canvas in Unity WebGL too: kzbin.info/www/bejne/o3quaniZrNx4g7s It's very similar to this but we use a raw image to display the video.
@kprogram8870
@kprogram8870 Жыл бұрын
@@maxodidily The video you presented is to do it with a video that has already been prepared, and what I want is to print a video that shares the real-time screen on the UI. Is there a way?
@luiginicastro1101
@luiginicastro1101 Жыл бұрын
Odd I get this error : "VideoPlayer cannot play url : C:/Users/Colt/Documents/GitHub/TheContemporaryHub/TheContemporaryHub/Assets/StreamingAssets" but when I check the debug it does call the video location properly. Any ideas?
@maxodidily
@maxodidily Жыл бұрын
That is odd. In your video player script, what have you done for the videoPath string? And what value are you assigning to the videoFileName string?
@luiginicastro1101
@luiginicastro1101 Жыл бұрын
@@maxodidily I did it the same as the video but funny enough it still works even with the error popping up
@maxodidily
@maxodidily Жыл бұрын
That's even stranger. Is this an error you get in Unity or a web browser?
@luiginicastro1101
@luiginicastro1101 Жыл бұрын
In Unity but after an Editor reset it is gone. Putting it in the unexplained mystery bin @@maxodidily
@maxodidily
@maxodidily Жыл бұрын
Mysteries like that are one of the joys of Unity.
@abobaaboba5902
@abobaaboba5902 6 ай бұрын
Bro, please tell me what to do if I did everything like in your video, but I have a problem. when I click start the game, the video is not displayed, although it is inside the camera, but the video is displayed in the unity editor, what should I do bro??? version unity 2022 and 2d project
How to Play a Video on a UI Canvas in Unity Webgl (Simple)
6:19
Max O'Didily
Рет қаралды 5 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4 МЛН
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 32 МЛН
女孩妒忌小丑女? #小丑#shorts
00:34
好人小丑
Рет қаралды 97 МЛН
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 15 МЛН
Making a VIRUS for a Game Jam (and almost winning)
9:36
Deynum Studio
Рет қаралды 313 М.
Can AI code Flappy Bird? Watch ChatGPT try
7:26
candlesan
Рет қаралды 9 МЛН
The biggest lie in video games
15:18
AIA
Рет қаралды 1,8 МЛН
I Paid Fiverr Game Developers to Make the Same Game
10:25
BadGameDev
Рет қаралды 683 М.
How to Become a Game Designer
15:08
Game Maker's Toolkit
Рет қаралды 1,1 МЛН
I Spent 6 Years Making Games in Scratch
10:03
chipm0nk
Рет қаралды 335 М.
The Most Impressive Scratch Projects
11:00
DenshiVideo
Рет қаралды 4,9 МЛН
Making a Game With C++ and SDL2
8:14
PolyMars
Рет қаралды 1,7 МЛН
Why Making Multiplayer Games SUCKS
6:46
Tom Weiland
Рет қаралды 421 М.
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 32 МЛН