Socket
Socket
Sign inDemoInstall

@motumb2b/react-modal-video

Package Overview
Dependencies
13
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @motumb2b/react-modal-video

Modal Video Viewer


Version published
Maintainers
1
Created

Readme

Source

react-modal-video

React Modal Video Component

Features

  • Not affected by dom structure.
  • Beautiful transition
  • Accessible for keyboard navigation and screen readers.
  • Rich options for youtube API and Vimeo API

Demo

http://rawgit.com/appleple/react-modal-video/master/test/

Install

npm

npm install react-modal-video

Usage

import sass file to your project

@import 'node_modules/react-modal-video/scss/modal-video.scss';

change "isOpen" property to open and close the modal-video

import React from 'react'
import ReactDOM from 'react-dom'
import ModalVideo from 'react-modal-video'

class App extends React.Component {

  constructor () {
    super()
    this.state = {
      isOpen: false
    }
    this.openModal = this.openModal.bind(this)
  }

  openModal () {
    this.setState({isOpen: true})
  }

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

ReactDOM.render(
  <App />,
    document.getElementById('root')
)

Options

propertiesdefault
channel'youtube'
youtubeautoplay1
cc_load_policy1
colornull
controls1
disablekb0
enablejsapi0
endnull
fs1
h1null
iv_load_policy1
listnull
listTypenull
loop0
modestbrandingnull
originnull
playlistnull
playsinlinenull
rel0
showinfo1
start0
wmode'transparent'
theme'dark'
vimeoapifalse
autopausetrue
autoplaytrue
bylinetrue
callbacknull
colornull
heightnull
loopfalse
maxheightnull
maxwidthnull
player_idnull
portraittrue
titletrue
widthnull
xhtmlfalse
youkuautoplay1
show_related0
ratio'16:9'
allowFullScreentrue
animationSpeed300
classNamesmodalVideo'modal-video'
modalVideoClose'modal-video-close'
modalVideoBody'modal-video-body'
modalVideoInner'modal-video-inner'
modalVideoIframeWrap'modal-video-movie-wrap'
modalVideoCloseBtn'modal-video-close-btn'
ariaopenMessage'You just openned the modal video'
dismissBtnMessage'Close the modal by clicking here'

Licence

MIT

FAQs

Last updated on 07 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc