Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-modal-video

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-modal-video - npm Package Compare versions

Comparing version 1.2.5 to 1.2.6

4

package.json
{
"name": "react-modal-video",
"version": "1.2.5",
"version": "1.2.6",
"main": "lib/index.js",

@@ -31,3 +31,3 @@ "description": "Modal Video Viewer",

"browserify": "^13.1.1",
"eslint": "^3.13.0",
"eslint": "^4.18.2",
"eslint-config-airbnb": "^13.0.0",

@@ -34,0 +34,0 @@ "eslint-config-airbnb-base": "^11.0.1",

@@ -29,3 +29,28 @@ # react-modal-video

```
### Functional Implementation with Hooks
```jsx
import React,{useState} from 'react'
import ReactDOM from 'react-dom'
import ModalVideo from 'react-modal-video'
const App = () => {
const [isOpen, setOpen] = useState(false)
return (
<React.Fragment>
<ModalVideo channel='youtube' autoplay isOpen={isOpen} videoId="L61p2uyiMSo" onClose={() => setOpen(false)} />
<button className="btn-primary" onClick={()=> setOpen(true)}>VIEW DEMO</button>
</React.Fragment>
)
}
ReactDOM.render(
<App />,
document.getElementById('root')
)
```
### Class Implementation
change "isOpen" property to open and close the modal-video

@@ -54,6 +79,6 @@

return (
<div>
<React.Fragment>
<ModalVideo channel='youtube' isOpen={this.state.isOpen} videoId='L61p2uyiMSo' onClose={() => this.setState({isOpen: false})} />
<button onClick={this.openModal}>Open</button>
</div>
</React.Fragment>
)

@@ -60,0 +85,0 @@ }

@@ -24,3 +24,3 @@ import React from 'react'

return (
<div>
<React.Fragment>
<ModalVideo channel='youtube' isOpen={this.state.isOpen} videoId='L61p2uyiMSo' youtube={{mute:1,autoplay:1}} onClose={() => this.setState({isOpen: false})} />

@@ -45,3 +45,3 @@ <button onClick={this.openModal}>Open YouTube</button>

</div>
</React.Fragment>
)

@@ -48,0 +48,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc