|
|
|
#1
|
|||
|
|||
|
http://www.livestream.com/userguide/...php/Player_API
Question: I'm trying to figure out how one uses the setDevKey function to pass the API key to the module. Does anyone know how this done? |
|
#2
|
|||
|
|||
|
yes i want to know too. where exactly do you put setDevKey()?
|
|
#3
|
|||
|
|||
|
The right moment to pass the dev key to the player is after you've received the "ready" event and before you set the channel and start the playback of the stream.
Cheers |
|
#4
|
|||
|
|||
|
do you have an example? i still don't get it. none of the functions are interacting with the player
|
|
#5
|
|||
|
|||
|
<html>
<head> <title>Livestream API for web developers - example</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> params = {AllowScriptAccess: 'always'}; function livestreamPlayerCallback(event){ if (event == "ready") { player.setDevKey("YOUR_KEY_HERE"); player.setChannel("YOUR_CHANNEL_HERE"); player.startPlayback(); } } swfobject.embedSWF("http://cdn.livestream.com/chromelessPlayer/wrappers/JSPlayer.swf","livestreamPlayer", "400", "300", "9.0.0", "expressInstall.swf", null, params); function init() { player = document.getElementById("livestreamPlayer"); } </script> </head> <body onload="init()"> <div id="livestreamPlayer"> <h1>This page requires flash</h1> <p><a href="http://www.adobe.com/go/getflashplayer">download flash</a></p> </div> </body> </html> This _should_ work, but I doesnt (for me). Anyone seeing the problem here? Of course I used my key and channel. Also swfobject.js and expressInstall.swf are placed in the same folder as the html. Edit: The code works fine if I run it localy, but once I upload it to our webserver it doesnt work anymore. I tryed to generate several keys to test, but none of them seem to work: h1472988.stratoserver.net h1472988.stratoserver.net/ h1472988.stratoserver.net/tst h1472988.stratoserver.net/tst/ h1472988.stratoserver.net/tst/test.html stratoserver.net stratoserver.net/ stratoserver.net/tst stratoserver.net/tst/ stratoserver.net/tst/test.html I breakpointed the livestreamPlayerCallback function and found out that livestreamPlayerCallback is being called, but once it tries to run player.setDevKey the code seems to stop. Last edited by FVMK; 26th August 2009 at 14:05. |
|
#6
|
|||
|
|||
|
Thanks for the feedback guys.
It seems we had an issue with our HTML API, that is fixed now. Can you try clearing your cache and reloading your test page? If you right-click the player, the JSPlayer version should be 1.1.13. Thanks |
|
#7
|
|||
|
|||
|
great! works now
|
|
#8
|
|||
|
|||
|
Here Im back again.
I have a serious problem with the HTML API on Internet Explorer. The player loads and works fine untill you try to control it via JavaScript. Unce I call the function player.play(); the player calls the callback functions in a loop. Here is an example code I used to test this issue: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Livestream API for web developers - example</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> flashvars = { channel: 'livestreamapi43' }; params = { AllowScriptAccess: 'always' }; function livestreamPlayerCallback(event) { if (event == "ready") { alert("Player is ready!"); player.setDevKey("YOUR_KEY_HERE"); player.play(); } } swfobject.embedSWF("http://cdn.livestream.com/chromelessPlayer/wrappers/JSPlayer.swf","livestreamPlayer", "400", "300", "9.0.0", "expressInstall.swf", flashvars, params); function init() { player = document.getElementById("livestreamPlayer"); } </script> </head> <body onload="init()"> <div id="livestreamPlayer"> <p>PLAYER HERE</p> </div> </body> </html> As you can see, I used the the alert function to pop up when the player is ready. But once I call player.play() the player continuously calls the callback function. When you delete the alert-line youll see that the browser freezes and consums a huge amount of memory. Used most current IE with most current FlashPlayer. Dont know how older IE-Versions behave. Any way to fix this? Also the code works fine with Firefox (dont know about Opera, Chrome, etc.) |
|
#9
|
|||
|
|||
|
Thanks for reporting this, we seem to have an issue with Internet Explorer and are looking into it.
I'll keep you posted. |
|
#10
|
|||
|
|||
|
Hi FVMK,
We've fixed the issues occurring with Internet Explorer. The latest version of the JSPlayer is 1.1.16, you can check it by right-clicking on the player. Can you check if everything works out now ? Thanks |
![]() |
| Tags |
| api devkey key |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|