Unity - How do I play video from URL ?

December 20, 2013 - 1:47am #1

The Vuforia VideoPlayback sample demonstrates how to play videos and to render them as an augmentation of your image targets (video on texture).

The samples use video files that are stored in the assets directory.

However, it is also possible to play videos that are streamed from a URL (e.g. from the internet).

In the sample, you can achieve this by:

  • selecting the one of the Image Targets in the Hierarchy view (in the Unity Editor) and explanding it to show the Video game object underneath (i.e. the child of the image target )
  • selecting the Video gameobject and change the Path variable in the Inspector view (under the VideoPlaybackBehaviour component), replacing the existing filename (e.g. VuforiaSizzleReel_1.m4v) with the URL of the video you want to play  e.g. http://my.org.com/my_videos/my_video.mp4).
  • Build and deploy the udated sample to your device

Note that some video URLs may not work; in particular,  the Web Server you are connecting to must conforms to the http Live Streaming protocol; also, the URL must point to an actual video file (such as .mp4 or .m4v); 

to test this functionality, you can use this sample video:






Topic locked