• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by hugamer_ · Oct 20, 2015 at 11:36 PM · iphonehandheldplayfullscreenmovievideo memory

[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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image akeplinger · Oct 29, 2015 at 06:32 PM 0
Share

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.

avatar image teexiii · Jan 02, 2018 at 11:18 AM 0
Share

I love you!

avatar image
0

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image IvanQuirino · Mar 22, 2016 at 05:45 PM 0
Share

they work, but you should create the folders you want first with Directory.CreateDirectory

avatar image
0

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image IvanQuirino · Mar 23, 2016 at 02:00 PM 0
Share

It works, I just did it yesterday. I am using this solution to place my videos in subdirectories.

avatar image magnusfox · Dec 08, 2016 at 03:25 PM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Add a skip button onto Video Android/iOS? 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

Handheld.PlayFullScreenMovie on iOS not loading video 0 Answers

Remove controls bar of playing video on Android / IOS 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges