Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The existing video player integration relies on an event named 'player_ready'. Similarly, to facilitate interaction with the betslip, an event named 'multibet-event' needs to be consumed.

 

Code Block
window.addEventListener('geniussportsmessagebus', (event) => {
    if (typedEvent.detail.type = 'multibet-event') {
    ...
    } else if (typedEvent.detail.type === 'player_ready') {
    ....
    }

The ‘multibet-event' supports ‘addToBetslip’, ‘removeFromBetslip’, ‘placeBet’ and the '

...

openBetslip’ commands inside the body.

These commands are accessible in the body of the events raised by the video player.

Code Block
if (typedEvent.detail.type = 'multibet-event') {
        switch(typedEvent.detail.body.command) {
            case "addToBetslip":
            ...
            break;
            case 'removeFromBetslip':
            ...
            break;
            case "placeBet":
            ...
            break;
            case 'removeFromBetslip'"openBetslip":
            ...
            break;
        }
} else ...
  

The data contained in the betslip command to "addToBetslip" | "removeFromBetslip" is structured as follows:

Code Block
interface BetslipEvent {
    command: "addToBetslip" | "removeFromBetslip",
| "placeBet" ,     sportsbookFixtureId: string,
    marketId: string,
    sportsbookMarketId: string,
    sportsbookMarketContext: string,
    sportsbookSelectionId: string,
    decimalPrice: string,
    stake?: number //optional
}

...

Code Block
{
    "command": "addToBetslip",
    "sportsbookFixtureId": "56789",
    "marketId": "100120022",
    "sportsbookMarketId": "1234567",
    "sportsbookMarketContext": "ABCDE",
    "sportsbookSelectionId": "2132365",
    "decimalPrice": "1.66",
    "stake": undefined
}

...

sportsbookFixtureId - customer fixture ID

...

marketId - Genius Sports market ID

...

sportsbookMarketId - customer market ID

...

The data contained in the betslip command to "placeBet" is structured as follows:

Code Block
interface BetslipEvent {
    command: "placeBet" ,
    markets: [ 
        {
            sportsbookFixtureId: string,
            marketId: string,
            sportsbookMarketId: string,
            sportsbookMarketContext: string,
            sportsbookSelectionId: string,
            decimalPrice: string,
            stake?: number //optional
        },
    ]
}

The following is an example of the structure of these events:

Code Block
{
  "command": "placeBet",
  "markets": [ 
    {
      "sportsbookFixtureId": "56789",
      "marketId": "100120022",
      "sportsbookMarketId": "1234567",
      "sportsbookMarketId: "",
      "sportsbookMarketContext": "ABCDE",
      "sportsbookSelectionId": "2132365",
      "decimalPrice": "1.66",
      "stake": undefined
    },
    {
      "sportsbookFixtureId": "56789",
      "marketId": "100120023",
      "sportsbookMarketId": "1234567",
      "sportsbookMarketContext": "ABCDE",
      "sportsbookSelectionId": "2132365",
      "decimalPrice": "1.32",
      "stake": undefined
    }
  ] 
}
  • sportsbookFixtureId - customer fixture ID

  • marketId - Genius Sports market ID

  • sportsbookMarketId - customer market ID

  • sportsbookMarketContext - customer market context. This field will be populated only if the customer provided it in UpdategramResponse

  • sportsbookSelectionId - customer selection ID

  • decimalPrice - the price that was displayed in the Multibet Widget when the player pressed the "Add to betslip" button. This value should NOT be used for bet acceptance.

  • An optional stake value which is can be one of the following values: a number, null, or undefined.

The data contained in the betslip command to "openBetslip" is structured as follows:

Code Block
interface BetslipEvent {
    command: "openBetslip"
}

The following is an example of the structure of these events:

Code Block
{
  "command": "openBetslip"
}

Tilting the native device and full screen

...