# Interface: PixellotPlayerCore
Core Player interface.
This interface implements any Core Player that Player SDK uses.
# Hierarchy
PixellotPlayerCore
# Table of contents
# Properties
# Accessors
- autoplay
- controls
- currentTime
- duration
- element
- hasStarted
- isFullscreen
- isLive
- isMuted
- isPaused
- poster
- readyState
- rootElement
- src
- userActive
- videoElement
- videoHeight
- videoWidth
- volume
# Methods
# Properties
# ads
• ads: PlayerAds
# analytics
• analytics: PlayerAnalytics
# id
• id: string
| number
# theoPlayer
• Optional
theoPlayer: any
# vdjsPlayer
• Optional
vdjsPlayer: any
# Accessors
# autoplay
• get
autoplay(): boolean
Gets or sets autoplay for player
player.autoplay = true // sets player into autoplay mode
# Returns
boolean
• set
autoplay(value
): void
Gets or sets autoplay for player
player.autoplay = true // sets player into autoplay mode
# Parameters
Name | Type |
---|---|
value | boolean |
# Returns
void
# controls
• get
controls(): boolean
Gets or sets showing player controls
- The state of showing controls
// get
const isControlsShown = player.controls;
// set
player.controls = false; // Hide player controls
# Returns
boolean
• set
controls(value
): void
Gets or sets showing player controls
- The state of showing controls
// get
const isControlsShown = player.controls;
// set
player.controls = false; // Hide player controls
# Parameters
Name | Type |
---|---|
value | boolean |
# Returns
void
# currentTime
• get
currentTime(): number
Gets or sets the current time (in seconds)
# Returns
number
• set
currentTime(value
): void
Gets or sets the current time (in seconds)
# Parameters
Name | Type |
---|---|
value | number |
# Returns
void
# duration
• get
duration(): number
Returns video duration Normally gets the length in time of the video in seconds;
The duration of the video in seconds
player.duration; // prints current video duration.
# Returns
number
# element
• get
element(): HTMLElement
# Returns
HTMLElement
# hasStarted
• get
hasStarted(): boolean
Returns true
if video playback has been started, otherwise false
const isLive = player.isLive();
# Returns
boolean
# isFullscreen
• get
isFullscreen(): boolean
Returns true
if player is in fullscreen mode, false
otherwise
# Returns
boolean
# isLive
• get
isLive(): boolean
Returns true
if player in live mode, false
otherwise
# Returns
boolean
# isMuted
• get
isMuted(): boolean
Returns true
if player is muted, false
otherwise
# Returns
boolean
# isPaused
• get
isPaused(): boolean
Returns true
if player is paused, false
otherwise
# Returns
boolean
# poster
• get
poster(): string
Gets or sets the poster image source url
# Returns
string
• set
poster(src
): void
Gets or sets the poster image source url
# Parameters
Name | Type |
---|---|
src | string |
# Returns
void
# readyState
• get
readyState(): READY_STATE
Returns player's readyState
property which indicates the readiness state of the media.
More info: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState
const readyState = player.readyState;
# Returns
READY_STATE
# rootElement
• get
rootElement(): HTMLElement
Returns video duration Normally gets the length in time of the video in seconds;
- The duration of the video in seconds when getting
player.getDuration();
# Returns
HTMLElement
# src
• get
src(): string
Get or set the video source. This method will set source explicitly to the core video player, so you may miss some of Player SDK features (like pano for eg.).
# Returns
string
• set
src(src
): void
Get or set the video source. This method will set source explicitly to the core video player, so you may miss some of Player SDK features (like pano for eg.).
# Parameters
Name | Type |
---|---|
src | string |
# Returns
void
# userActive
• get
userActive(): boolean
# Returns
boolean
• set
userActive(state
): void
# Parameters
Name | Type |
---|---|
state | boolean |
# Returns
void
# videoElement
• get
videoElement(): null
| HTMLVideoElement
# Returns
null
| HTMLVideoElement
# videoHeight
• get
videoHeight(): number
# Returns
number
# videoWidth
• get
videoWidth(): number
# Returns
number
# volume
• get
volume(): number
Gets or sets current volume of the media
- The current volume as a percent when getting
// get
const currentVolume = player.volume;
// set
player.volume = 0.5; // Set volume to half
# Returns
number
• set
volume(value
): void
Gets or sets current volume of the media
- The current volume as a percent when getting
// get
const currentVolume = player.volume;
// set
player.volume = 0.5; // Set volume to half
# Parameters
Name | Type |
---|---|
value | number |
# Returns
void
# Methods
# destroy
▸ destroy(): void
Destroys the video player and does any necessary cleanup
player.destroy();
# Returns
void
# exitFullscreen
▸ exitFullscreen(): void
Return the video to its normal size after having been in full screen mode
player.exitFullscreen();
# Returns
void
# pause
▸ pause(): Promise
<void
>
Pauses video playback
player.pause();
# Returns
Promise
<void
>
# play
▸ play(): Promise
<void
>
Starts playing video playback
player.play();
# Returns
Promise
<void
>
# requestFullscreen
▸ requestFullscreen(): void
Increase the size of the video to full screen
player.requestFullscreen();
# Returns
void
# stop
▸ stop(): void
Stops media playback and resets player
player.stop();
# Returns
void