UNPKG

react-jw-player-ts

Version:

A fork of react-jw-player rewritten in typescript

16 lines (15 loc) 558 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const types_1 = require("../types"); function initialize({ component, player, playerOpts }) { player.setup(playerOpts); /* Link callbacks to native jwplayer events */ Object.keys(component.props).forEach(callbackName => { const eventName = types_1.callbackToEventMap[callbackName]; if (eventName) { const callback = component.props[callbackName]; player.on(eventName, callback); } }); } exports.default = initialize;