Parameters
Name |
Type |
Description |
props |
object
|
Properties
Name |
Type |
Argument |
Default |
Description |
matchId |
string
|
|
|
Match Id.
|
disableWidgetHeader |
boolean
|
<optional>
|
false
|
When set to true , hides widget header.
|
disableMatchHeader |
boolean
|
<optional>
|
false
|
When set to true , hides match header.
|
collapseGameInformation |
boolean
|
<optional>
|
true
|
When set to false , opens the game information section
|
useTeamColors |
boolean
|
<optional>
|
null
|
Valid values are:
null (the default) = settings from the client configuration are used. If the client is configured to use team colors, then the theme can be overriden with the teamColorsTheme parameter.
true = team colors will be used, as specified with the teamColorsTheme parameter. If the teamColorsTheme is not specified and the client configuration does not specify a team colors theme, or if the teamColorsTheme contains an invalid theme name, then team colors will not be used.
false = team colors will not be used.
|
teamColorsTheme |
string
|
<optional>
|
null
|
When set (and not disabled by useTeamColors), specifies the name of the formula to calculate team colors
(e.g. mono-team-colors-light ).
|
enableTeamSelect |
boolean
|
<optional>
|
false
|
When set to true , enables team selection. Interactive areas are:
- team name and crest in a match header,
- rows in the scoring table of the match header,
- team crest in the section headers,
player names and images in the Leaders section.
TeamId is emitted on click or touch.
|
enablePlayerSelect |
boolean
|
<optional>
|
false
|
When set to true , enables player selection. Interactive areas are:
- player names and images in the Leaders section.
PlayerId is emitted on click or touch.
|
onItemClick |
function
|
<optional>
|
|
Function/event handler. By default all widget click target areas are disabled; enableTeamSelect enables team targets and enablePlayerSelect enables a player targets.
|
onTeamSelected |
function
|
<optional>
|
|
Team targets function/event handler. Deprecated. Use onItemClick instead.
|
onPlayerSelected |
function
|
<optional>
|
|
Player targets function/event handler. Deprecated. Use onItemClick instead.
|
onTrack |
function
|
<optional>
|
|
Function/event handler, see Widgets.onTrack .
|
border |
boolean
|
<optional>
|
|
If true , it draws a border around widget.
|
|
Examples
HTML/Declarative
<div class="sr-widget" data-sr-widget="us.match.nfl.summary" data-sr-match-id="sd:match:2724b0ed-71b1-4c35-a977-087f4f9404f4"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/uscommon/widgetloader" data-sr-language="en_us" async></script>
JS/Programmatic
<script>
(function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
)})(window,document,"script","https://widgets.media.sportradar.com/uscommon/widgetloader","USW", {
language: 'en_us'
});
USW('addWidget', '#sr-widget', 'us.match.nfl.summary', {matchId: 'sd:match:2724b0ed-71b1-4c35-a977-087f4f9404f4'});
</script>
<div id="sr-widget"></div>
Examples of onItemClick targets and emitted props
"team",{"teamId":"sd:team:82cf9565-6eb9-4f01-bdbd-5aa0d472fcd9","matchId":"sd:match:ee83c78d-f7eb-46fc-a851-e5e3b2a82f44","seasonId":2020,"seasonType":"REG","week":10,"awayTeamId":"sd:team:82cf9565-6eb9-4f01-bdbd-5aa0d472fcd9","homeTeamId":"sd:team:d26a1ca5-722d-4274-8f97-c92e49c96315","awayTeamUid":"4421","homeTeamUid":"367364"}
"player",{"playerId":"sd:player:5812204c-6dae-4450-8011-99e0f72864ac","teamId":"sd:team:d26a1ca5-722d-4274-8f97-c92e49c96315","matchId":"sd:match:ee83c78d-f7eb-46fc-a851-e5e3b2a82f44","seasonId":2020,"seasonType":"REG","week":10,"awayTeamId":"sd:team:82cf9565-6eb9-4f01-bdbd-5aa0d472fcd9","homeTeamId":"sd:team:d26a1ca5-722d-4274-8f97-c92e49c96315","awayTeamUid":"4421","homeTeamUid":"367364"}