Virtual Horses Kiron

UI - Visualization component

The Virtual Horses Kiron visualization component is delivered as an iframe with a responsive interface.

Below URL provides an example as shown on Sportradar’s Virtual Sports Demonstratorarrow-up-right:

https://{domain}/vhk/vhk/index?clientid={clientid}&lang={style}&style={style}&oddType={oddType}
Parameter
Required
Description

clientid

required

Identifies you as a bookmaker in our system. The id will be provided to you by your technical account manager.

lang

optional

Specifies the display language in the visualization component(ISO 639-1 specification).

Most European language are already available and other can be added on demand

style

optional

If needed, your technical account manager will provide you with a style parameter. If not provided, the default style will be applied and there is no further action needed from your side.

oddType

optional

Specifies the odds display format. The parameter does not have impact on how odds are calculated and only triggers a simple conversion from decimal odds to the specified odds format. If this is not specified, the default odds format will be decimal.

Multi language support is available by optional language parameter in URL. Most common languages are already supported, others on demand.

Cross-origin communication between UI and parent iframe

We need to enable communication between the UI and market offer (e.g. switch the odds section to selected match day by mouse click at a match day button within the match day selector component).

Listening to postMessages

For Virtual Horses Kiron, you have to setup an event listener for postMessages:

window.addEventListener("message", receiveMessage);
  • messageType can be of the following:

    • setHeight

    • svg:response

    • switchEvents

  • messageData.type could be competitor (for jersey), form, rating or lengthbehindwinner

  • messageData should contain always race (e.g: vhc:stage:3717087), competitor (e.g.: sr:competitor:456545) and sport vhk

switchEvents

This postMessage is called once after loading the page, each time a user clicks a race in the ‘Race Calendar’, as well as, when a race starts.

This function can be used to bring the race related odds to the users focus by scrolling the odds list to this position:

Sending postMessages

You can send postMessages to the iframe in order to retrieve a competitor's jockey jerseys, rating or form.

Messages to the iframe must be of messageType svg:request. Examples of such messages can be seen below.

Getting jockey jerseys

You can download jockey jerseys as Scalable Vector Graphic in order to embed it into your market offer:

You can do by sending the following request via postMessage to the iframe.

Getting form

You can download the competitor's form as Scalable Vector Graphic in order to embed it into your market offer:

You can do so by sending the following request via postMessage to the iframe.

Getting rating

You can download the competitor's rating as Scalable Vector Graphic in order to embed it into your market offer:

by sending the following request via postMessage to the iframe.

Getting length behind winner

You can download a competitor's length behind winner as Scalable Vector Graphic in order to embed it into your market offer:

You can do so by sending the following request via postMessage to the iframe.

Last updated

Was this helpful?