Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
This post has been wikified, any user with enough reputation can edit it.
avatar image
2
Question by danielqenk · Feb 23, 2016 at 05:49 PM · video

Download or Stream Video

Hello, is there a way to make a menu where the user can decide to download a video to the phone (Using memory of iphone for example) or stream from the web? Regards

Comment
Add comment · Show 6
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 Magius96 · Feb 23, 2016 at 05:53 PM 0
Share

First, work out two seperate functions. One will download the video and play it. The other will play the video by strea$$anonymous$$g it.

From there, its as simple as showing the user a UI with two buttons, and depending upon which button is clicked, call the appropriate function.

avatar image danielqenk Magius96 · Feb 23, 2016 at 06:31 PM 0
Share

Thank you! Do you have any idea how can i make that code, im trying that for 2 weeks and nothing :( Regards

avatar image Magius96 danielqenk · Feb 24, 2016 at 01:27 AM 1
Share

You'll want to use the WWW class for getting the file or stream. I'll show you how to get the file or stream, but what to do with it after that is up to you, as I haven't worked with video files in Unity.

     public IEnumerator DownloadFile(string url)
     {
         var www = new WWW(url);
         yield return www;
         if (string.IsNullOrEmpty(www.error))
         {
             var filebytes = www.bytes;
             $$anonymous$$emoryStream stream = new $$anonymous$$emoryStream(filebytes);
         }
         else
         {
             Debug.Log(string.Format("An error occurred while downloading the file: {0}", www.error));
         }
     }
 

This is the method that you can use to download the file, and I provided the line that converts it into a $$anonymous$$emoryStream.

Show more comments
avatar image sarahcastella · May 26, 2018 at 09:51 AM 0
Share

Yes, but you can try this website which easy download your facebook video in a sec

https://fvdtube.com/facebook-video-downloader/

Follow Simple Step:-

Step 1: Login Facebook.com.

Step 2: Select the video you want to download & select show url.

Step 3: Copy the url of the video you want to download.

Step 4: Open our facebook downloader tool & paste the link in text box.

Step 5: Select download button. it will give you two choices “Download SD” & “Download HD”.

Step 6: Select the option of your choice. All done.

avatar image malik619 · Apr 12, 2020 at 01:22 PM 0
Share

If you want to download videos from Twitter then you can use Twitter Video Downloader its easy and free. You will be able to download your video in few steps.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by faizidp · Jan 20, 2018 at 11:06 PM

Yes you can! You can use UnityWebRequest or WWW to download the video from web URL in the form of bytes in persistent Data Path. And then use that path as value of "URL" in VideoPlayer component introduced in recent version of Unity (2017.1 I guess).

For Downloading the video:

 IEnumerator testVideoDownload(){
 var www = new WWW ("http://clips.vorwaerts-gmbh.de/VfE_html5.mp4");
 Debug.Log ("Downloading!");
 yield return www;
 File.WriteAllBytes(Application.persistentDataPath+"/videoFile.mp4",www.bytes);
 Debug.Log ("File Saved!");
 }

Setting Up Video Player

Create a Quad. Add VideoPlayer component to it. Choose Source to URL. Set "Play On Awake" to false.

Script for Video Player to Play the video.

 using UnityEngine.Video;       //Make sure to add this
 .
 .
 public GameObject VideoPlayerGO;
 VideoPlayer video Player;
 
 void Awake(){
 videoPlayer=VideoPlayerGO.GetComponent<VideoPlayer>();
 }
 void Start(){
 PlayVideo("videoFile.mp4");
 }
 void PlayVideo(string fileName){
 videoPlayer.source = Application.persistentDataPath + fileName;
 videoPlayer.Play();
 }
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
avatar image
0

Answer by Mayank516 · Jan 24 at 06:53 PM

I have used following plugins for streaming in iOS :

To Stream audio: https://assetstore.unity.com/packages/tools/audio/audio-stream-in-ios-182585

To Stream Video : https://assetstore.unity.com/packages/tools/integration/video-streaming-in-ios-98645

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.

Follow this Question

Answers Answers and Comments

49 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image 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

How to create 360 video from unity? 0 Answers

using points tracker on video - like UK driving hazard perception test 1 Answer

How i can fix this code ? 1 Answer

Play video in reverse? 0 Answers

Unity 5 mobile video stops after a second using Handheld.PlayFullScreenMovie() 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges