Skip to main content

Overview

The Players service allows you to create customized HTML5 video player configurations with your own branding, colors, logos, and behavior settings. These players can be used with both live streams and video-on-demand content.

Player Object

The Player object defines the appearance and behavior of the video player.
id
int64
Player ID
name
string
required
Player name for identification
framework
string
Player framework type (e.g., video.js, clappr)
autoplay
bool
Video playback behavior:
  • true: Video starts playing automatically on load
  • false: User must click play (default)
mute
bool
Sound volume on load:
  • true: Video starts muted
  • false: Video starts with volume on (default)
bg_color
string
Skin background color in format #AAAAAA
fg_color
string
Skin foreground color (UI elements) in format #AAAAAA
hover_color
string
Color of elements when mouse hovers, in format #AAAAAA
text_color
string
Text elements color in format #AAAAAA
URL to logo image displayed on player
logo_position
string
Logo position on player:
  • tl: Top left
  • tr: Top right
  • bl: Bottom left
  • br: Bottom right
disable_skin
bool
Player skin visibility:
  • true: Skin is disabled (no controls visible)
  • false: Skin is enabled (default)
show_sharing
bool
Sharing button visibility:
  • true: Sharing button is displayed (default)
  • false: No sharing button
speed_control
bool
Playback speed control button:
  • true: Speed control button is displayed
  • false: No speed control (default)
save_options_to_cookies
bool
Persist user settings:
  • true: Volume and options saved in cookies (default)
  • false: Settings not saved
custom_css
string
Custom CSS injected into player iframe
design
string
Additional JavaScript parameters rendered to player
js_url
string
Custom player JavaScript file URL. Leave empty to use default.
skin_is_url
string
URL to custom skin JavaScript file

Create Player

Create a custom player configuration.
player.go
player, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name:         "Branded Player",
        Autoplay:     gcore.Bool(false),
        Mute:         gcore.Bool(false),
        BgColor:      gcore.String("#1a1a1a"),
        FgColor:      gcore.String("#ff3366"),
        HoverColor:   gcore.String("#ff6699"),
        TextColor:    gcore.String("#ffffff"),
        Logo:         gcore.String("https://example.com/logo.png"),
        LogoPosition: gcore.String("tr"),
        ShowSharing:  gcore.Bool(true),
        SpeedControl: gcore.Bool(true),
    },
})
player.name
string
required
Player name
player.autoplay
bool
Enable automatic playback. Default: false
player.mute
bool
Start with volume muted. Default: false
player.bg_color
string
Background color (e.g., #1a1a1a)
player.fg_color
string
Foreground/UI elements color (e.g., #ff3366)
player.hover_color
string
Hover state color (e.g., #ff6699)
player.text_color
string
Text color (e.g., #ffffff)
Logo image URL
player.logo_position
string
Logo position: tl, tr, bl, br
player.disable_skin
bool
Disable player controls. Default: false
player.show_sharing
bool
Show sharing button. Default: true
player.speed_control
bool
Show speed control button. Default: false
player.save_options_to_cookies
bool
Save user preferences. Default: true
player.custom_css
string
Custom CSS styles
player.framework
string
Player framework type

Update Player

Update an existing player configuration.
player.go
player, err := client.Streaming.Players.Update(
    context.TODO(),
    playerID,
    streaming.PlayerUpdateParams{
        Player: streaming.PlayerParam{
            Name:     "Updated Player Name",
            BgColor:  gcore.String("#000000"),
            Autoplay: gcore.Bool(true),
        },
    },
)

Get Player

Retrieve player configuration details.
player.go
player, err := client.Streaming.Players.Get(context.TODO(), playerID)

fmt.Printf("Player: %s\n", player.Name)
fmt.Printf("Autoplay: %v\n", player.Autoplay)
fmt.Printf("Colors: BG=%s, FG=%s\n", player.BgColor, player.FgColor)

List Players

Retrieve a paginated list of all players.
player.go
page, err := client.Streaming.Players.List(context.TODO(), streaming.PlayerListParams{
    Page: gcore.Int64(1),
})

for _, player := range page.Items {
    fmt.Printf("%d: %s\n", player.ID, player.Name)
}

// Auto-pagination
autoPager := client.Streaming.Players.ListAutoPaging(context.TODO(), streaming.PlayerListParams{})
for autoPager.Next() {
    player := autoPager.Current()
    fmt.Printf("%s\n", player.Name)
}

Delete Player

Delete a player configuration.
player.go
err := client.Streaming.Players.Delete(context.TODO(), playerID)
Deleting a player that is in use by broadcasts or videos may cause them to fall back to the default player.

Preview Player

Get an HTML preview of the player configuration.
player.go
err := client.Streaming.Players.Preview(context.TODO(), playerID)

Player Templates

Dark Theme Player

player.go
darkPlayer, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name:         "Dark Theme",
        BgColor:      gcore.String("#000000"),
        FgColor:      gcore.String("#ffffff"),
        HoverColor:   gcore.String("#cccccc"),
        TextColor:    gcore.String("#ffffff"),
        Autoplay:     gcore.Bool(false),
        ShowSharing:  gcore.Bool(true),
        SpeedControl: gcore.Bool(true),
    },
})

Branded Corporate Player

player.go
corpPlayer, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name:         "Corporate Branded",
        BgColor:      gcore.String("#1a1a2e"),
        FgColor:      gcore.String("#0f4c75"),
        HoverColor:   gcore.String("#3282b8"),
        TextColor:    gcore.String("#bbe1fa"),
        Logo:         gcore.String("https://company.com/logo.png"),
        LogoPosition: gcore.String("tr"),
        Autoplay:     gcore.Bool(false),
        Mute:         gcore.Bool(false),
        ShowSharing:  gcore.Bool(true),
    },
})

Minimal Player (No Controls)

player.go
minimalPlayer, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name:        "Minimal",
        DisableSkin: gcore.Bool(true),
        Autoplay:    gcore.Bool(true),
        Mute:        gcore.Bool(true),
    },
})

Auto-Play Muted Player (Mobile-Friendly)

player.go
mobilePlayer, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name:                 "Mobile Autoplay",
        Autoplay:             gcore.Bool(true),
        Mute:                 gcore.Bool(true),
        SaveOptionsToCookies: gcore.Bool(true),
        BgColor:              gcore.String("#1a1a1a"),
        FgColor:              gcore.String("#ffffff"),
    },
})

Educational Player with Speed Control

player.go
eduPlayer, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name:         "Educational",
        SpeedControl: gcore.Bool(true),
        ShowSharing:  gcore.Bool(false),
        Autoplay:     gcore.Bool(false),
        BgColor:      gcore.String("#2c3e50"),
        FgColor:      gcore.String("#3498db"),
        TextColor:    gcore.String("#ecf0f1"),
    },
})

Custom CSS Examples

Hide Specific Controls

player.go
player, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name: "Custom Controls",
        CustomCss: gcore.String(`
            /* Hide volume control */
            .vjs-volume-control { display: none !important; }
            
            /* Customize progress bar */
            .vjs-progress-holder {
                height: 8px !important;
            }
            
            /* Round corners */
            .video-js {
                border-radius: 12px;
                overflow: hidden;
            }
        `),
    },
})

Custom Branding Overlay

player.go
player, err := client.Streaming.Players.New(context.TODO(), streaming.PlayerNewParams{
    Player: streaming.PlayerParam{
        Name: "Branded Overlay",
        CustomCss: gcore.String(`
            /* Add watermark */
            .video-js::after {
                content: 'Company Name';
                position: absolute;
                bottom: 60px;
                right: 20px;
                background: rgba(0, 0, 0, 0.7);
                color: white;
                padding: 5px 10px;
                border-radius: 4px;
                font-size: 12px;
                z-index: 1;
            }
        `),
    },
})

Using Players with Content

Assign Player to Broadcast

player.go
broadcast, err := client.Streaming.Broadcasts.New(context.TODO(), streaming.BroadcastNewParams{
    Broadcast: streaming.BroadcastNewParamsBroadcast{
        Name:      "Event with Custom Player",
        StreamIDs: []int64{streamID},
        PlayerID:  gcore.Int64(playerID),
    },
})

Assign Player to Video

Players can also be associated with individual videos (consult the Videos API for details).

Best Practices

Color Selection

  • Use high contrast between bg_color and text_color for readability
  • Test hover_color to ensure visibility on both light and dark backgrounds
  • Follow your brand guidelines for consistency

Autoplay Considerations

  • Mobile browsers often block autoplay with sound
  • Use autoplay: true with mute: true for reliable mobile autoplay
  • Consider user experience - not all users appreciate autoplay

Logo Placement

  • tr (top right) is most common for branding
  • Keep logos small to avoid obstructing content
  • Use transparent PNG format for best results

Performance

  • Minimize custom CSS complexity
  • Test player on multiple devices and browsers
  • Use save_options_to_cookies to remember user preferences

Accessibility

  • Ensure sufficient color contrast (WCAG AA: 4.5:1 minimum)
  • Don’t disable controls unless necessary
  • Provide alternative access methods for key functions

Build docs developers (and LLMs) love