import videojs , { VideoJsPlayer } from 'video.js' ; import Player from '../index' ; function initializePlayer ( playerRef , playerOptions , manualPlugins ) { const player = videojs ( playerRef , playerOptions ) ; const videoSrc = playerOptions . src ; const videoPoster = playerOptions . poster ; videoSrc && player . src ( videoSrc ) ; videoPoster && player . poster ( videoPoster ) ; manualPlugins . map ( element => { element . plugin && videojs . registerPlugin ( element . name , element . plugin ) ; player [ element . name ] ( player , element . options ) ; } ) ; return player ; } export default initializePlayer ;