0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

動画ファイルを再生するReact-Player引っかかったところメモ

Posted at

##自分用メモ

windows10
wsl2:ubuntu
node: v15.9.0
react: 17.0.1
react-player:2.9.0

create-react-appして動画ファイルを使いたいときインストールしたのがReact-Player。

ubuntu
npm i -s react-player

で、実装。

App.js
import ReactPlayer from 'react-player'

function App() {
    return (
        <div>
           <ReactPlayer url='videos/〇〇.mp4' playing width="100%" loop/>
        </div>
    )
}
export default App

この時パスわかんなくなってハマりました。
react-playerではpublicフォルダの中を見ているようで、public以下のパスを記述して見れるようになりました。以上。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?