Socket
Socket
Sign inDemoInstall

@lin-media/highlight

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lin-media/highlight

highlight


Version published
Maintainers
1
Install size
329 kB
Created

Readme

Source

自定义进度条提示点

安装

npm i @lin-media/highlight

初始化

import MediaPlayer from "@lin-media/player";
import Highlight from "@lin-media/highlight";
MediaPlayer.use(Highlight);

const highlightList = [
  {
    time: 20,
    text: "这是第 20 秒"
  }
];
const player = new MediaPlayer({
  // ...
  Highlight: {
    // 点击跳转到提示点的时间点,默认true
    jump: true,
    // 显示点击的提示点的文本,默认true
    showTip: true
    // 提示点列表,直接通过options参数传入,或者调用set()
    list:highlightList
  }
});

// 或者通过 `player.highlight.set()` 设置。
player.highlight.set(highlightList);

// 销毁提示点
player.highlight.destroy();

// 监听提示点点击事件
player.$on("highlight-click", (item) => {
  console.log(item);
});

Highlight 参数

参数说明类型可选值默认值
jump点击是否跳转到提示点的时间点booleantrue
showTip是否显示点击的提示点的文本booleantrue
list提示点列表,格式见下方Array

事件

事件名称说明回调参数
highlight-click点击提示点的时候触发event

API

  • player.highlight.set(list:Array) : 设置提示点列表

  • player.highlight.destroy() : 销毁提示点

list 格式

字段说明类型
time时间点number
text显示文本string

Keywords

FAQs

Last updated on 05 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc