I have a function imported from npm that’ll open VLC media player given a path of a video file as its argument. It works fine for relative file paths. But, when I pass it a path like D:/some_video.mp4, it doesn’t work. The docs says it’ll accept a string path to a video file.
How to fix this?
Code:
let VLC = require('vlc-simple-player');
let path = "./1x01 Pilot.avi";
//Start a fullscreen player
let player = new VLC(path, {arguments: ['--fullscreen', '--no-video-title']});
// Close the player after the video has 'stopped'
player.on('statuschange', (error, status) => {
if (status.state == 'stopped') player.quit();
});
This script is in local disk (C:) and I can give a path relative to this. What if I wanted to play some file that’s in local disk (D:)?
Well, copy-pasting exactly what I said would definitely not work. I do not know what your working directory looks like. If you want more help, you will have to copy the full path to your workspace (where your Javascript file is), and the full path to the video you want opened. Then, I would be able to help.
Of course, I did not copy-paste. I used the same pattern for file locations indicated in your example.
Script location: C:\Users\skand\OneDrive\Desktop\vlc\vlc_cli.js
Video location: D:\1x01 Pilot.avi
It didn’t work. I also tried with a colon next to D (D:) like in your first example and it didn’t work either.
So, may be the function don’t support these kinds of file paths?