Creating an IFRAME using JavaScript (OLD)

From BetgamesTV
Jump to navigation Jump to search

Insert this block of JavaScript code to your page's <body> tag and replace script parameters. This code will generate the iFrame (it's height will be calculated and set automatically as well).

<!-- betgames.tv iframe -->
<script type="text/javascript"> 
	var _bt = _bt || [];    
	_bt.push(['server', '<your_production_server>']);
	_bt.push(['partner', '<your_partner_code>']);
	_bt.push(['token', '<player_token>']);
	_bt.push(['language', '<language_code>']);
	_bt.push(['timezone', '<timezone_utc>']);
	//_bt.push(['is_mobile', '<is_mobile>']);
	//_bt.push(['current_game', '<current_game>']);
	//_bt.push(['odds_format', '<odds_format>']);
	//_bt.push(['home_url', '<home_button_url>']);
	
	(function(){
	document.write('<'+'script type="text/javascript" src="<your_production_server>/design/client/js/betgames.js?ts=' + Date.now() + '"><'+'/script>');
	})();
</script>
<script type="text/javascript">BetGames.frame(_bt);</script>
<!-- // -->

If after loading iframe whole page is cleared, add < div > with id=“betgames_div_iframe” to the page. Iframe will be inserted inside this div.

NOTE: The iFrame is mobile friendly: responsive design (scales to mobile (from 350px to 767px) and desktop (from 768px) views) and HLS video stream for mobile devices.

Here you can find how to customize iFrame's CSS: Customizing CSS


Explanation of parameters

Parameter Description
your_production_server given by BetGames.TV engineer. For testing use https://integrations01.betgames.tv, for production - i.e. https://game.betgames.tv, https://game.betgamestv.ru (for Russian market).

Important: make sure you use HTTP Secure protocol - https://

your_partner_code given by BetGames.TV engineer.
player_token you should replace it with your newly generated tokens for authorized players. For not logged in players token is "-".
language_code check the List of supported languages for the proper language code.
timezone_utc timezone UTC (i.e. "-2", "0", "2", "2.5", "3", "5.45").
is_mobile optional parameter to distinguish platform ("1"-mobile). For more information, please check the Is_mobile parameter functionality description.
current_game optional parameter for redirecting to desired game. Check the List of Game ID's. "-1" - will redirect to Lobby page; "results" - will redirect to Results page.
odds_format optional parameter for displaying odds in different formats (possible options: "american", "decimal", "fractional", "hongkong"; default option - "decimal").
home_button_url optional parameter for displaying "Home" button in the mobile iFrame view, which is forwarding player to the provided URL address (make sure URL begins with "http://" or "https://").