- Home /
[SOLVED] Download movie using WWW and play using Handheld.PlayFullScreenMovie does not work on iOS but works on Android
I am downloading a video from web using WWW. Then I save the file using:
path = Application.persistentDataPath + "/" + filename; File.WriteAllBytes(path, www.bytes);
It works well in both android and ios devices. Then I use the same path to play the video:
Handheld.PlayFullScreenMovie(path, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFill);
In Android the video plays normally, but in iOS the player opens and closes in less than one sec. How can I download this video, save in the device memory, and then play de fullscreen video from memory?
Answer by hugamer_ · Oct 20, 2015 at 11:17 PM
I solved the problem! When useing Handheld.PlayFullScreenMovie on iphone you need to use "file://" before the path.
Still having issues on iOS, playing a downloaded video.
The persistent data path appears to be:
/var/mobile/Containers/Data/Application/8EEC5B83-CE1A-479F-BC12-14B8458500B2/Documents
Entire path to the file:
filepath = "file:///var/mobile/Containers/Data/Application/8EEC5B83-CE1A-479F-BC12-14B8458500B2/Documents/fileData/Company%20Info/company_info.mp4"
I tell it to play:
Handheld.PlayFullScreen$$anonymous$$ovie ( filepath,Color.black);
I get a black screen for 1/2 second and no console message. I've tried a few other variations of the file path. FileExists() returns true. No idea why this doesn't work. Possibly doesn't want the file in a subfolder or something along those lines.
Answer by Jon-Huhn · Feb 29, 2016 at 01:39 AM
And I've just confirmed that subfolders won't work. You need to dump your movies into the root folder.
they work, but you should create the folders you want first with Directory.CreateDirectory
Answer by akeplinger · Mar 23, 2016 at 01:30 PM
At the time this bug was created trying to view a movie contained in a subfolder did not work. Verified by checking "FileExists()" and downloading app device image showing working file.
Also tested using one version of code which saved same movie file with the file path with the filename concatenated to place the movie file at the root. We were using code to generate a folder structure which was working for other media, like Jpgs, so Directory.CreateDirectory() was working properly for displaying that media, just not movie files.
Now, maybe it's fixed at this point, but at the time it definitely wasn't working.
It works, I just did it yesterday. I am using this solution to place my videos in subdirectories.
I can confirm this is still not solved, as of this date. I'm using Unity 5.5.0f3, and playing video on a Samsung S6 does not work from any subfolders. As stated by others, loading other content such as music and image files does work.
Playing directly from the root of Application.persistentDataPath
does work. Has this been reported as a bug, anyone knows?
Your answer
Follow this Question
Related Questions
handheld playfullscreenmovie crash on android 1 Answer
Add a skip button onto Video Android/iOS? 0 Answers
Handheld.PlayFullScreenMovie on iOS not loading video 0 Answers
Exiting video (started with Handheld.PlayFullScreenMovie) causes a crash on Kindle Fire. 1 Answer
[SOLVED] Does someone have a working script sample with Handheld.Playfullscreenmovie on Android ? 1 Answer