@gumlet/react-embed-player

中文文档
2.1.1发布于 2026/03/14TypeScriptESM + CJS构建来源已验证近 30 天下载 6598

Gumlet React Embed Player

原始使用文档
文档目录6 节
  1. Install
  2. Usage
  3. Props
  4. Methods
  5. Callbacks
  6. Maintainer

react-embed-player

Gumlet Embed player in react

NPM JavaScript Style Guide

Install

npm install --save @gumlet/react-embed-player

Usage

import React, { Component } from 'react'

import {GumletPlayer} from '@gumlet/react-embed-player'

class Example extends Component {
  render() {
    return <GumletPlayer
      videoID="64bfb0913ed6e5096d66dc1e"
      title="Gumlet Player Example"
      style={{height: "100vh", width: "100vw", position:"relative"}}
      schemaOrgVideoObject={{"@context":"https://schema.org","@type":"VideoObject","name":"Gumlet","description":"","embedUrl":"https://play.gumlet.io/embed/64bfb0913ed6e5096d66dc1e"}}
      autoplay={false}
      preload={false}
      muted={true}
    />
  }
}

Props

PropDescriptionDefault
videoID String RequiredVideo ID which is generated after processing the video on gumlet
isLive BooleanWhether the video is a live stream or notfalse
title StringTitle of the iframeGumlet video player
style ObjectStyle tag passed on to the iframe container{padding:"56.25% 0 0 0", position:"relative"}
schemaOrgVideoObject Objectschema.org object which is added to a script tag{}
autoplay BooleanShould the video autoplayDefault set in collection settings
preload BooleanShould the video preloadDefault set in collection settings
muted BooleanShould the video player be mutedDefault set in collection settings
gm_user_id StringUser ID passed to gumlet insights objectnull
gm_user_name StringUser name passed to gumlet insights objectnull
gm_user_email StringUser email passed to gumlet insights objectnull
gm_custom_data_1 StringCustom data 1 passed to gumlet insights objectnull
loop BooleanShould the video play in a loopDefault set in collection settings
drm_token StringToken generated on backend for DRM Protected contentnull
expires IntegerToken expiry time from epoch in millis for DRM protected contentnull
vast_tag_url StringURL Encoded VAST tag URLnull
start_high_res BooleanStart the video in the highest resolution availablefalse
disable_seek BooleanDisable the seek bar and removes forward and rewind buttonsfalse
disable_player_controls BooleanRemoves all player controls from the playerfalse
watermark_text StringWatermark text to be shown in the playernull
facebook_pixel_id StringFacebook pixel ID to be used to send data about playbacknull
ga_tracking_id StringGoogle pixel ID to be used to send data about playbacknull
t IntegerThe playback instant in seconds to start the video atnull
enabled_player_control ArrayOnly allow thes eplayer controls to be visiblenull

Methods

play: void Play the media:

pause: void Pause the media:

getPaused: boolean Determine if the media is paused:

mute: void Mute the media:

unmute: void Unmute the media:

getMuted: boolean Determine if the media is muted:

setVolume: void Set the volume. Value needs to be between 0-100:

getVolume: number Get the volume. Value will be between 0-100:

getDuration: number Get the duration of the media is seconds:

setCurrentTime: number Perform a seek to a particular time in seconds:

getCurrentTime: number Get the current time in seconds of the video:

setPlaybackRate: number Set the playback rate which are available in the player. Doesn't returns an error if the passed playback rate is not available.

getPlaybackRate: number Get the current playback rate of the player:

Callbacks

Callbacks that can be listened to.

onReady fired when the video is ready.

onProgress fires when the video is loading additional media for playback:

{
  percent: 0.8,
}

onTimeupdate fires during playback:

{
  seconds: 10,
  duration: 40
}

onPlay fires when the video starts to play.

onPause fires when the video is paused.

onEnded fires when the video is finished.

onFullScreenChange fires when the video fullscreen is changed:

{
  isFullScreen: true // or false
}

onPipChange fires when the video is put to or brought back from picture-in-picture.

{
  isPIP: true // or false
}

onPlaybackRateChange fires when the video playback rate is changed by user.

onAudioChange fires when the audio track of video is changed.

onQualityChange fires when the video quality is changed.

onVolumeChange fires when the volume level of the player is changed. It also gets fired when the player is muted or unmuted, along with muted and unmuted events respectively.

{
  volume: 50
}

onSeeked fires when the video has been seeked by the user. Gives seeked to time in seconds and total duration of video.

{
  seconds: 10
  duration: 50
}

onError fires when an error occurs.

Maintainer

This library is maintained by gumlet

版本与发布记录

@gumlet/react-embed-player 共发布 30 个版本,首次发布于 2024/08/05;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.1.1latest2026/03/148 个月前
2.1.02026/03/078 个月前
2.0.192025/07/041.4 年前
2.0.182025/07/041.4 年前
2.0.172025/06/251.4 年前
2.0.162025/06/131.4 年前

关于 @gumlet/react-embed-player 的常见问题

@gumlet/react-embed-player 是什么?

Gumlet React Embed Player

如何安装 @gumlet/react-embed-player?

在项目目录运行 npm install @gumlet/react-embed-player,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.1.0)、react-dom(^19.1.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gumlet/react-embed-player 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gumlet/react-embed-player 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gumlet/react-embed-player 可以商用吗?

@gumlet/react-embed-player 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@gumlet/react-embed-player 的下载量有多少?

根据 npm 官方下载统计,@gumlet/react-embed-player 在 2026/10/17 – 2026/11/15 这 30 天内被下载 6,598 次,日均约 220 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gumlet/react-embed-player 还在维护吗?

最新版本 2.1.1 发布于 2026/03/14(8 个月前);至今共发布 30 个版本,其中过去 12 个月发布了 2 个;首次发布于 2024/08/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。