Skip to main content

Configuration

Typically, integration with SX PlayerSDK and it's many lifecycle events happens entirely via callback functions that are defined within the Config object. These are divided into 3 objects, and 1 root element:

  • RootElement
  • customConfig
  • videoId
  • videoURL
  • type
  • playerID

All configuration options have defaults that use the StoryXpress domain.****

Config is generally an object in the following format:

const myAppearance = {...};
const myOverlays = {...};
const myTracks = {...};
const myBranding = {...};
const myShowCta = false;
const myAllowedDomainURL = ['https://storyxpress.co', 'https://www.storyxpress.co', ...];
const myPlaybackRates = [0.5, 1, 1.5, 2];
const myOnSubmitPass = (data) => {...};

const myRootElement = document.getElementById("myRootButton");

const Config = {
RootElement: myRootElement,
customConfig: {
appearance: myAppearance,
overlays: myOverlays,
tracks: myTracks,
branding: myBranding,
showCta: myShowCta,
allowedDomainURL: myAllowedDomainURL,
playbackRates: myPlaybackRates,
onSubmitPass: myOnSubmitPass,
time: {
startTime: 7,
endTime: 11,
},
callbackevents: {
onPlay,
onPause,
onFinish,
}
},
playerId: "asgard_default", // StoryXpress PlayerID
videoId : "video_id", // StoryXpress VideoID
// To playback a non-StoryXpress indexed video, use the following
videoURL : "https://vedge.ankitmishra.in/kyx7dsx12sp1agxpg",
type : "application/x-mpegURL"
};