简体   繁体   中英

How would I use a video player thats embedded through a script tag with react.js

I am trying to dynamically output some video content using an api (jwplayer). The api returns me some data to put in a script tag for instance: .js">

This tag works perfectly with plain html, but doesn't work with react jsx. How can I use this with a react component?

在npm上尝试使用此包react-jwplayer ,只需将videoId添加到该组件即可。

import JWPlayer from 'react-jwplayer'; <JWPlayer videoId="<your-id-here>" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM