- Home /
Video Streaming for Web Player
Hello all:
I am building a web player that right now is far too large. My main culprit are the videos that I still have inside of the build. So I have a question about streaming video, since I would like to get my videos out of my build to reduce the size of the web player.
I have not been able to find any tutorials or anything like that, and if you know of any please, by all means, provide links. But my question is this: when streaming video content, do the videos need to be hosted on a site, or can they just sit in a folder in the same location as my web player? As of right now I don't have a test server set up or anything like that, so I am at a loss of how to test to make sure I have my code written correctly. Actually, right now I don't even have any code written for streaming videos.
Any help would be greatly appreciated.
Thank you.
Answer by jonas-echterhoff · Oct 26, 2011 at 02:46 PM
Once you upload your web player somewhere, "Hosting on a site" and "Sitting in a folder in the same location as my web player" are the same, since you are hosting your web player on a site.
In the web player you can use relative URLs to find files next to your web player. Like this:
www = new WWW ("myMovie.ogg");
See here for a sample on how to stream a movie from a url.
Hahah, fair enough. Total brain fart on the "Hosting on a site" and "Sitting in a folder..." were the same thing. Something I already knew, and should have kept in $$anonymous$$d.
When writing my code and before creating the web player, I take it that it will work just fine in the editor if I write everything correctly, right?
Do .ogv files work, or do they have to be .ogg? I have found a script on the Unity Reference page that I am trying to get working, but my video never plays. When I run the script exactly as it is in the Reference page it works. That being said, I am also searching for my file in my machine's directory, not from a website.
Never$$anonymous$$d. Got the .ogv file working and grabbing the video from my directory, but I have to write out the full directory it seems.
The problem I am struggling with is the fact that I have about 8 different videos. When the user clicks on a certain item I want that video to spawn up. So I am still trying to figure out how to attack this. Thank you for your help earlier though.
How to Play the Strea$$anonymous$$g video in Android device or iphone device ? Can you help me.
Your answer
Follow this Question
Related Questions
How o I prevent streamed video stutter? 1 Answer
Unity simple client server video streaming using RPC calls to send webcamTexture 2 Answers
Streaming videos from web server in android 0 Answers
Cross Platform Video Streaming? 0 Answers
Is 4K webcam compatible with Unity 5.6 video player/webcamtexture? 0 Answers