Search Unity

AVPro Video - Opening a video with absolute path on Android

Discussion in 'Assets and Asset Store' started by burakalpyasar, Nov 27, 2019.

  1. burakalpyasar

    burakalpyasar

    Joined:
    Jul 19, 2019
    Posts:
    4
    I am trying to play a video from device storage on Android. It is working on PC with this code.

    _mediaPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, "C:/Users/HP/Desktop/Phone Terry.mp4", true);

    For Android, These are the paths I have used so far, none of them worked yet.

    *Phone storage
    • /storage/emulated/0/Download/Phone Terry.mp4 (This one in the manual)
    • /Storage/emulated/0/Download/Phone Terry.mp4 (Capital "S" at Storage)

    *Sd Card
    • /storage/SD/Dance/Sd Terry.mp4 (In the manual)
    • /Storage/SD/Dance/Sd Terry.mp4 (With the capital "S")
    • /storage/8A50-12E7/Dance/Sd Terry.mp4 (My phone says that is the path)
    • /Storage/8A50-12E7/Dance/Sd Terry.mp4 (With the capital "S")
    I am thinking that maybe I need to give access to application for accessing files on the device. Thanks in advance!
     
unityunity