How to use JavaScript in Samba Live

There might be situations where you'd like to modify a number of elements within your account and customize it according to preference. A branding feature is available to you starting from our Pro Plus Plan, which allows for these modifications through the use of JavaScript (custom scripts). 

Follow these steps to get started:

1. Log in to samba.live and click on Branding in the Welcome menu. 

2. Click on the JavaScript tab

3. In the Session Body JS field, type in the script to modify your account accordingly. 

Note: this is an optional beta branding feature. Please contact our support team to have it enabled on your account(s).

Custom Script Examples

If you're interested in giving our JavaScript feature a try, take a look at some of our custom script use cases below.

Adding a privacy statement to registration pages: 

<script>
if (document.title.indexOf("My Webinar Account Center - Join to Session") >= -1 && window.location.href.indexOf("samba.live/live/marketing") > -1)
{
$('#content').after('<span id="custom"></div>');
$( "#custom" ).html('<span style="color:white;"><br>If you have pre-registered for this webinar, please ensure you have entered the same email address you used to sign up with.<br><br> For external participants, by providing your email address to access this webinar you are consenting to COMPANY NAME HERE contacting you in relation to this activity, in line with <a href="https://www.COMPANYNAME.com/privacy-policy/" target="_blank">COMPANY NAME'S Privacy Policy</a><br><br>For all participants, you have previously consented to the privacy policy on enrolment to one of our programs.<em>*</em></span>');
}
</script>

Hiding the registered user tab when opening a meeting:

<script>
if (document.title.indexOf("Samba Live Account Center - Join to Session") >= -1 && window.location.href.indexOf("samba.live/live/USERNAMEHERE") > -1)
{
    $('a[href$="#login-tab"]').hide();
}
</script>
<script>
if(window.location.href.indexOf ("https://samba.live/live/USERNAMEHERE/" ) > -1)
{
$( "a:contains('Registered users')" ).hide();
}
</script>

Hiding the registered user tab for one particular session only:

<script> if(window.location.href.indexOf ("https://samba.live/live/USERNAMEHERE/allspeaker" ) > -1) { $( "a:contains('Registered users')" ).hide(); } </script>

Injecting custom CSS in login pages and meeting rooms:

<script>
if (document.title.indexOf("Join to Session") >= -1 && window.location.href.indexOf("go.meetingrooms.net/live") > -1 && $('.login').length && $('#footer').length  )
$('head').append('<link rel="stylesheet" href="../../storage/custom_branding/meetingrooms/mr-login-screen.css" type="text/css" />');if ( window.location.href.indexOf("go.meetingrooms.net/live") > -1 )
$('head').append('<link rel="stylesheet" href="../../storage/custom_branding/meetingrooms/meetingrooms.css" type="text/css" />');</script>

Adding custom text to the Guest Login name field:

<script> if(window.location.href.indexOf ("https://samba.live/live/USERNAMEHERE/" ) > -1) $("label[for='guest_name']").html('INSERT TEXT HERE'); </script>

Hiding the media loading icon while in session:

$('body').append('<style>.slides-loader {display: none!important}</style>');

Note: please ensure to check the scripts above for anything in ALL CAPS as these should be customized by you.