• 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
1
Question by BeHappy · Jan 03, 2013 at 05:30 AM · androidiphoneutils

Can i play a video directly from URL in mobile device ?

Is it possible to play a video directly from a URL in a mobile device ? I came across iphoneUtils.playmovieURL which is deprecated now,

Do i need to place the movie in my streaming assets folder to play it or any other way possible to play the video.

Kindly suggest.

Thank you.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by ytanay · Jan 03, 2013 at 06:20 AM

Acording to the Unity docs - this is currently unsupported.

http://docs.unity3d.com/Documentation/Manual/iphone-unsupported.html http://docs.unity3d.com/Documentation/Manual/android-unsupported.html

However...

This requires Unity Pro and iPhone Pro! Also, this code should work - I haven't tested it yet (I will do it soon).

There are 3 steps to do what you want.

  1. Download the file from the server

  2. Move the file to the proper directory

  3. Play the file

Assuming you know how to download a file using the WWW class, the Unity Docs tell us that the StreamingAssets folder path is different on every device - for iPhone, we can use:

 moviePath = Application.dataPath + "/Raw" + "/behappy-vide.mp4;

After saving the movie to the correct folder, all we have to do is call:

 Handheld.PlayFullScreenMovie (moviePath, Color.black, FullScreenMovieControlMode.CancelOnInput);

This will fade in to our video and play it.

Let me know if you need any help or if it doesn't work properly.

Comment
Add comment · Show 7 · 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 BeHappy · Jan 03, 2013 at 02:22 PM 0
Share

Let me check some other way then, Thanks ytanay.

avatar image ytanay · Jan 03, 2013 at 02:41 PM 0
Share

I'm not sure if this helps - but you can download the entire movie and then play it.

avatar image BeHappy · Jan 04, 2013 at 03:18 PM 0
Share

how is it possible ?? They ask me to put the files inside Streaming Assets folder to play it, but i need the video content to be dynamic, so once after i publish the app without updating it how can i download and play a new video :-(

avatar image ytanay · Jan 04, 2013 at 04:42 PM 1
Share

I updated the answer with the basic outline of what you need to do.

avatar image Zniper69 · Jan 31, 2014 at 10:58 AM 2
Share

Ins$$anonymous$$d of using:

moviePath = Application.dataPath + "/Raw" + "/behappy-vide.mp4;

I'll suggest just using:

moviePath = Application.streamingAssetsPath + "/behappy-vide.mp4;

That should be the same thing, as far as I know, and it should work on all platforms.

Show more comments
avatar image
2

Answer by Zogg · Nov 07, 2013 at 05:28 PM

I tried to save a video to said path, but it didn't work : When I try to write the file, I get an exception

UnauthorizedAccessException: Access to the path "/var/mobile/Applications/6FDD4123-B161-473B-A58F-F1C3FEC6589A/bluejacket.app/Data/Raw/TestVideo.mov" is denied.

I can't say I'm surprised. Writing a file to the device, just like this, without providing a written permission from the Apple CEO, provisioning profiles for your whole family, birth certificates (long form) of your grandparents and a sample of your dog's DNA isn't something Apple is likely to allow. It's probably easier to get the permission to hold a punk rock concert in the command center of Cheyenne Mountain.

Comment
Add comment · 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

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

12 People are following this question.

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

Related Questions

Regulate Vibration 2 Answers

Pausing a movie using iPhoneUtils.PlayMovie 2 Answers

IphoneUtils.PlayMovie for Android 1 Answer

isApplicationGenuine trustworthy on Android? 0 Answers

Unable to build to Android 2 Answers

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