Parameters
Name |
Type |
Description |
props |
object
|
Properties
Name |
Type |
Argument |
Default |
Description |
matchId |
number
|
|
|
Match id.
|
showDate |
boolean
|
<optional>
|
|
Shows the date of the future matches.
|
showOdds |
boolean
|
<optional>
|
true
|
If false hides odds (pre-match only).
|
isCollapsed |
boolean
|
<optional>
|
true
|
If false collapses collapsible content (i.e. game information).
|
disablePitch |
boolean
|
<optional>
|
|
If true hides the pitch diagram that is otherwise displayed during live games (live match only).
|
disableHeader |
boolean
|
<optional>
|
|
If true hides header.
|
disableBroadcastNetwork |
boolean
|
<optional>
|
|
if true it hides broadcast network info.
|
disableGameInfo |
boolean
|
<optional>
|
|
If true hides collapsible content (i.e. game information).
|
disableAttendance |
boolean
|
<optional>
|
|
If true hides attendance content.
|
autoSlide |
boolean
|
<optional>
|
true
|
Disables auto sliding of the content in game info section.
|
autoSlideSpeed |
number
|
<optional>
|
5000
|
Sets the delay of auto sliding of the content in game info section (in milliseconds).
|
disableTeamClick |
boolean
|
<optional>
|
|
If true disables onItemClick handler for teams.
|
disablePlayerClick |
boolean
|
<optional>
|
|
If true disables onItemClick handler for players (i.e. team leaders under game information).
|
enableMatchClick |
boolean
|
<optional>
|
|
If true whole widget triggers match target event on onItemClick; all other targets gets disabled.
|
preMatchLinks |
string
|
<optional>
|
|
Comma separated string of link keys for pre-match. Can be undefined , default , preview , boxscore , gametracker , recap . Entering default is same as entering 'preview' .
|
liveMatchLinks |
string
|
<optional>
|
|
Comma separated string of link keys for live-match. Can be undefined , default , preview , boxscore , gametracker , recap . Entering default is same as entering 'boxscore, gametracker' .
|
postMatchLinks |
string
|
<optional>
|
|
Comma separated string of link keys for post-match. Can be undefined , default , preview , boxscore , gametracker , recap . Entering default is same as entering 'boxscore, recap' .
|
border |
boolean
|
<optional>
|
true
|
If false hides the border around the widget.
|
onItemClick |
function
|
<optional>
|
|
Function/event handler. By default, the widget has two click target areas: team and player . The player targets appear in Game information section depending on match status.
With preMatchLinks , liveMatchLinks and/or postMatchLinks set the Score widget can get additional targets: preview , boxscore , gametracker , recap links.
When enableMatchClick set to true the whole Score widget becomes a match target and all other targets gets disabled.
All targets emit the following match props on click or touch: matchId , sportId , realCategoryId , seasonId , tournamentId , uniqueTournamentId , awayTeamUid , homeTeamUid , matchStatus .
Team target adds uniqueTeamId , player target adds playerId . Valid matchStatus values are: pre , live , post .
|
|
Examples
HTML/Declarative
<div class="sr-widget" data-sr-widget="us.match.ncaaf.score" data-sr-match-id="14340119"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/uscommon/widgetloader" data-sr-language="en_us" async></script>
JS/Programmatic
<div id="sr-widget"></div>
<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.ncaaf.score', {matchId: 14340119});
</script>
JS/Example of using Event Handlers
<div id="sr-widget"></div>
<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.ncaaf.score', {matchId: 14340119, postMatchLinks: 'default', onItemClick: function(target, obj){alert(target+':'JSON.stringify(obj));}});
</script>
Examples of onItemClick targets and emitted props
"team",{"matchId":25131128,"seasonId":75095,"tournamentId":76282,"uniqueTournamentId":27625,"realCategoryId":43,"sportId":16,"awayTeamUid":4352,"homeTeamUid":4312,"matchStatus":"post","uniqueTeamId":4352}
"player",{"matchId":25131128,"seasonId":75095,"tournamentId":76282,"uniqueTournamentId":27625,"realCategoryId":43,"sportId":16,"awayTeamUid":4352,"homeTeamUid":4312,"matchStatus":"post","playerId":1235378}
"recap",{"matchId":25131128,"seasonId":75095,"tournamentId":76282,"uniqueTournamentId":27625,"realCategoryId":43,"sportId":16,"awayTeamUid":4352,"homeTeamUid":4312,"matchStatus":"post"}
"match",{"matchId":25131128,"seasonId":75095,"tournamentId":76282,"uniqueTournamentId":27625,"realCategoryId":43,"sportId":16,"awayTeamUid":4352,"homeTeamUid":4312,"matchStatus":"post"}