#1  
Old 9th August 2009, 05:14
zupraner zupraner is offline
Junior Member
 
Join Date: Sep 2008
Posts: 9
Default Player API is up - who knows how to use the DevKey?

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?
Reply With Quote
  #2  
Old 12th August 2009, 06:38
kentor kentor is offline
Member
 
Join Date: Apr 2009
Posts: 32
Default

yes i want to know too. where exactly do you put setDevKey()?
Reply With Quote
  #3  
Old 12th August 2009, 11:10
paul167 paul167 is offline
Livestream Software Engineer
 
Join Date: Sep 2008
Posts: 190
Default

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
Reply With Quote
  #4  
Old 13th August 2009, 03:16
kentor kentor is offline
Member
 
Join Date: Apr 2009
Posts: 32
Default

do you have an example? i still don't get it. none of the functions are interacting with the player
Reply With Quote
  #5  
Old 14th August 2009, 04:03
FVMK FVMK is offline
Junior Member
 
Join Date: Aug 2008
Posts: 22
Lightbulb

<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.
Reply With Quote
  #6  
Old 14th August 2009, 09:43
paul167 paul167 is offline
Livestream Software Engineer
 
Join Date: Sep 2008
Posts: 190
Default

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
Reply With Quote
  #7  
Old 15th August 2009, 18:30
kentor kentor is offline
Member
 
Join Date: Apr 2009
Posts: 32
Default

great! works now
Reply With Quote
  #8  
Old 25th August 2009, 09:32
FVMK FVMK is offline
Junior Member
 
Join Date: Aug 2008
Posts: 22
Exclamation Player API @ IE8

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.)
Reply With Quote
  #9  
Old 25th August 2009, 17:23
paul167 paul167 is offline
Livestream Software Engineer
 
Join Date: Sep 2008
Posts: 190
Default

Thanks for reporting this, we seem to have an issue with Internet Explorer and are looking into it.

I'll keep you posted.
Reply With Quote
  #10  
Old 26th August 2009, 12:06
paul167 paul167 is offline
Livestream Software Engineer
 
Join Date: Sep 2008
Posts: 190
Default

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
Reply With Quote
Reply

Tags
api devkey key

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump