init()
init()
method must be called. The iFrame is not mounted until the init method is called.
The init method must be called to initialize or mount the Metered Embed. You can call the init method as soon as the page loading is complete or you can call the init method after some user interaction, if you want the Embed to appear based on user action.
The init method takes two argument, one is the options
and seconds in the dom element.
var frame = new MeteredFrame();
frame.init({
roomURL: "appname.metered.live/my-room",
}, document.getElementById("metered-frame"));
Here is the complete list of options avaliable:
Option | Required | Description | Default Value |
---|---|---|---|
roomURL | YES | URL of the Meeting Room | |
width | NO | Specify the width of the embed | 100% |
height | NO | Specify the height of the embed | 600px |
autoJoin | NO | When autoJoin is true then users will not be presented with a Join Meeting/Lobby page and will be automatically join into the meeting. This property can also be set in the room settings, and whatever pass here will override the room settings. | false or whatever set in the Room Settings. |
name | NO | Name of the user. Used with autoJoin. Specify the name of the user and set autoJoin to true to automatically join the user with the specified name | |
accessToken | NO | Used with autoJoin. Specify the accessToken and set autoJoin to true to automatically join. | |
joinVideoOn | NO | Can also be set in the room settings. Whatever specified here will overried the room settings | true or whatever set in the Room Settings |
joinAudioOn | No | Can also be set in the room settings. Whatever specified here will overried the room settings | true or whatever set in the Room Settings |
showInviteBox | No | When there is only one participant in the meeting, an invite box is shown with insturctions to invite other users. If this is set to false the invite box is hidden | true or whatever set in the Room Settings |
disableScreenSharing | No | If screen-sharing is enabled in the room settings, then using this parameter you can disable the screen-sharing for one embed or a particular set of users. It can only be used to disable screen-sharing. If screen-sharing is disabled in the room setting this property cannot be used to enable screen-sharing. | false |
disableChat | No | If chat is enabled in the room settings, then this setting can be used to disable chat in the specific embed where this parameter is passed. | false |
With the init options you can control the behavior of the embed, for e.g if you want to autoJoin the users on some pages of your application or support you want to build a livestreaming application and want to disable audio/video and chat until the user logged-in but still want to give the user ability to view the livestream, so you can do all this by passing appropriate parameters to the init method.