API example usage:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php $api_key= <your api key>; $api_pass= <your api pass>; $epid = <episode number>; $ch = curl_init("https://admin.pegsystems.com/api/Episode/$epid"); curl_setopt($ch,CURLOPT_HTTPHEADER,array('Authorization: '.base64_encode($api_key. ':' . $api_pass))); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); $result = curl_exec($ch); curl_close($ch); $obj = json_decode($result); print_r($obj); ?> |
Using JW Player Example with the API:
This assume that the $row is a returned object from the Episode api
Note: PEGSystems only supports JWPlayer 5.X at this time
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<div id="video_player"> <a href="http://www.macromedia.com/go/getflashplayer">Get Flash</a> to see this player. </div> <script type="text/javascript" src="./jwplayer.js"></script> <script type='text/javascript'> jwplayer('video_player').setup({ 'allowfullscreen':'true', 'repeat':'list', 'flashplayer': './player.swf', 'controlbar': 'bottom', 'width': '512', 'height': '384', 'modes': [ { type: 'html5', config: { 'file':'<? print $row->html5mp4 ?>', 'provider': 'video' } }, { type: 'flash', src: './player.swf', config: { 'file':'<? print $row->playlist ?>' } } ], 'image':'<? print $row->image ?>' }); </script> |
1 2 3 4 5 |
<?php ?> |