- Home /
is it possible to play video directly from android
hello everyone i want play a video that is stored in android internal storage; i can play a video from local disk from pc but i can't play from android some says use WWW but i don't know how to script that can some one help me please thanks.
Answer by ZhaoJiawei2333 · Apr 10, 2018 at 01:35 PM
Here is a sample using WWW to load a movie.
string filePath = "jar:file:///storage/emulated/0/movie.ogg";
MoviewTexture mt;
AudioClip clip;
Material playerMat;
WWW www;
void Start()
{
StartCoroutine(LoadMovie());
}
IEnumerator LoadMovie()
{
www = new WWW(filePath);
mt = www.movie;
clip = mt.audioClip;
playerMat.mainTexture = mt;
yield return www;
}
"jar:file:///storage/emulated/0/movie.ogg" is the path to Android internal storage.
Answer by SkyAngel_AOG · Apr 10, 2018 at 09:48 AM
Hi, @harisurya883!
Read the documentation. It will help you)
https://docs.unity3d.com/560/Documentation/ScriptReference/Video.VideoPlayer.html https://docs.unity3d.com/ScriptReference/Handheld.PlayFullScreenMovie.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
video is not playing; Using Url 0 Answers