MediaPlayer:LiveEvents

From Metrixstream
Revision as of 20:55, 19 March 2011 by MetrixAdmin (Talk | contribs)

Jump to: navigation, search

Contents

Getting Started

Events are defined by the media player. When certain actions happen, the media player can notify you which event just took place. From there you can decide trigger another action or ignore it.

JavaScript Definitions

<script type="text/javascript">

var MCONST_CHAT = 0;
var MCONST_NOTICE = 1;
var MCONST_ENTER = 2;
var MCONST_ACCESS_PUBLIC = 3;
var MCONST_ACCESS_PRIVATE_EXCLUSIVE = 4;
var MCONST_MODE_CHANGE = 5;
var MCONST_SHUTDOWN = 6;
var MCONST_ENTER_VOYEUR = 7;
var MCONST_ACCESS_PRIVATE_GROUP = 8;
var MCONST_LEAVE = 9;
var MCONST_HEARTBEAT = 10;
var MCONST_GIFT = 11;

</script>

Variables of the Event

Most events have the same variables associated with them. Each event below will give the exact variables that are accessible with the particular event. The exhaustive list of all the variables across all events are the following.

msgtype
This contains one of the values defined above.
msg
This is the actual message of the event that should be displayed to the viewer.
user
This is the username of the sender of the event.
host
This determines of the event is coming from the Host of the live event or a viewer.

MCONST_CHAT

This event occurs whenever there is a new chat message. This is the build block to creating your own HTML chat widget. This event also comes bundled with a username of the chat sender, the actual chat message, and whether or not the user is the Host of the live event or a viewer.

MCONST_NOTICE

This event occurs whenever the player is unable to perform a certain action. A typical scenario would be the user sending too many messages. This event would be triggered telling them to slow down. This event comes bundled with the notice message.

MCONST_ENTER

This event occurs when someone starts viewing the live event. Normally this results in adding the user to the viewer roster, so that everyone can see all of the viewers of the live event. This event comes bundled with the enterer's username.

MCONST_ACCESS_PUBLIC

This event occurs when the access mode of the event goes public. A public live event means that there are no restrictions on who can view it. It also means the event is being broadcasted for free.

Personal tools