You are viewing an old version of this content. View the current version.
Compare with Current
View Version History
« Previous
Version 3
Next »
Description
The method TouchCastPlayerAPI.embed()
allows you to embed touchcast players into any webpage you want.
You can embed an unlimited number of players.
TouchCastPlayerAPI.embed(config);
Parameters
Name | Description | Type |
---|
config | Object with these possible properties: container[string]* - mandatory, represents a CSS selector for a container where the TouchCast player should be embedded. For example it can have a value of #player-container or .player-container . That means that somewhere on your webpage you should have a container like <div id="player-container"></div> or <div class="player-container"></div> width[string]* - mandatory, represents the player width. It accepts values like "100%" or "640" height[string]* - mandatory, represents the player height. It accepts values like "100%" or "400px" videoUrl[string]* - mandatory, represents a touchcast video url.playerId[string]* - mandatory, represents a unique id for the player; helpful to identify the player instance.themeConfiguration[object] - an object that allows to customize player appearance. It accepts these possible properties:
defaultStreamVariant[number] - start level for HLS. Possible values: 0, 1, 2, 3, 4 ... . Default 0startTime[number] - time when video start in seconds. Default 0interactiveTip[boolean] - Interactive guide, Default false interactiveTipShowTime[number] - Time(in milliseconds) when interactive tip can be visible after load tc. Default 5000 defaultSearchLanguage[string] - default language for search. Possible values: language abbreviation. Default "en" endScreen[boolean] playControl[boolean] logoInControls[boolean] volumeControl[boolean] timingControl[boolean] infoControl[boolean] shareControl[boolean] shareToSocial[boolean] fullscreenControl[boolean] commentsControl[boolean] - summaryControl[boolean]
- searchControl[boolean]
- subtitlesControl[boolean]
- pipPosition[string]
- controlsColor[string]
- subtitlesBackgroundColor[string]
- subtitlesTextColor[string]
- playerBackgroundColor[string]
- progressUpdateColor[string]
- summaryTrailerDuration[number]
- summaryNoSkip[boolean]
| object |
Example
TouchCastPlayerAPI.embed({
container: '#player-container',
videoUrl: 'https://portaldev.touchcast.io/files/YSAgICAgICAgICAgICAgIHdQR2NuL3RpVDJFQm1COTVKUHRSY2pzVi95cy83L3dhVTgvRE5GM3pMUGdFY0ZvekR2ZTY1UnpGM1UrR1hvNEg=',
playerId: ,
width: '960px',
height: '405px',
playerConfig: {
controlsColor: 'rgba(79, 56, 189, 0.66)',
playerBackgroundColor: 'grey',
progressUpdateColor: 'green',
interactiveTip: false,
playControl: false,
volumeControl: false,
logoInControls: true,
timingControl: false,
infoControl: false,
shareControl: false,
commentsControl: false,
summaryControl: true,
searchControl: false,
subtitlesControl: false,
fullscreenControl: true,
},
});