Is it possible to load a VideoClip from file

I like the new Video Player functionality in 5.6, but I really need to be able to load videos from file. I know you can get a MovieTexture with a URL/file path using the WWW class. Is there something similar for video clips or perhaps a way of converting a MovieTexture to a VideoClip?

1 Like

You can read the raw bytes downloaded with WWW class and write it to a file. I’ve done this already and it works

I think you misunderstood the question. I want to load a video from file so I can play it using the new video player in 5.6, which uses a VideoClip as an input. However I had missed that the video player can just take a URL as an input instead and that URL can point to a local file.

we can set url to play video. I tested and it worked on PC.

videoPlayer.url = "/Users/john/Movies/trailer.mov";
1 Like

It works like you said!

1 Like

Hey,
I would like to see a similar functionality with WWW class for VideoClips as it is for AudioClips today (replacing GetMovieTexture).

WWW www = new WWW("file://" + this.localAudioPath);
AudioClip clip = www.GetAudioClipCompressed(false);

Will this be possible for VideoClips in the near future?

1 Like

I’m also looking for the answer. I’m using EasyMovieTexture and I would like to play video clip on EMT too. Because in IOS I would like to play alpha video.

It works fine in Editor but application crashes when i build for Mac Standalone
Any reason why ??

Because you are on Mac Standalone check this :

  • if you use the good symbol for a folder.
  • Warning once you build you don’t have the same authorization to access file and the path you use to access it can change.

can i see ur code…?
Thank u…