How can I use react-player to play videos from a local file path? #2013
Unanswered
liaodalin19903
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, while reviewing react-player, I noticed that it primarily handles online video playback, as shown in the test file:
https://github.com/cookpete/react-player/blob/master/test/ReactPlayer/staticMethods.js
The tests use web-based video URLs:
test('canPlay()', (t) => {
t.ok(ReactPlayer.canPlay('https://www.youtube.com/watch?v=oUFJJNQGwhk'));
t.ok(ReactPlayer.canPlay('https://youtube.com/shorts/370kwJ-x5TY?feature=share'));
t.ok(ReactPlayer.canPlay('https://vimeo.com/90509568'));
t.ok(ReactPlayer.canPlay('https://home.wistia.com/medias/e4a27b971d'));
t.ok(ReactPlayer.canPlay('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'));
t.ok(ReactPlayer.canPlay('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4#t=1'));
t.notOk(ReactPlayer.canPlay('http://example.com/random/path'));
});
How can I use react-player to play videos from a local file path?
Beta Was this translation helpful? Give feedback.
All reactions