Software Archive
Read-only legacy content
17061 Discussions

Using a Video Player plug- in

Slavi_I_
Beginner
245 Views

Hello,

I want to use this plug- in in my project https://github.com/moust/cordova-plugin-videoplayer . But it seems to work only with full path of the video and not with for example "assets/videos/exampleVideo.mp4". It works perfectly when the video is from the internet though.

What is the full path to my www folder of the project? I mean what path should I use if I want to play this exampleVideo.mp4 in my assets folder.

Thank you.

0 Kudos
2 Replies
Swati_S_Intel1
Employee
245 Views

Use this function to get the webroot:

function getWebRoot() {
    "use strict" ;
    var path = window.location.href ;
    path = path.substring( 0, path.lastIndexOf('/') ) ;
    return path ;
}
0 Kudos
Slavi_I_
Beginner
245 Views

Thank you!

0 Kudos
Reply