MediaPlayer:LiveEvents

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Personal tools