🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

xuliang_bp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

xuliang_bp

专供CY使用

unpublished
latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

先安装依赖

yarn add xuliang_bp

然后就可以开始使用了~~

    import {draws} from 'xuliang_bp'

    const Ocan = new draws({
		  arr: arr,
		  dom: '#myCanvas',
		  maxHeight: maxHeight,
		  onChange:onChange.bind(this), // 点击canvas调整进度  会返回点击处百分比
    });

	function onChange(percent){
		console.log(percent); // 0.45	 0.56	 0.87
		audio.currentTime = audio.duration*percent;
	}

	audio.ontimeupdate=function(){
		const width = (audio.currentTime / audio.duration)*canvasWidth;
		Ocan.beginDraw(width);
	}

    //Ocan.beginDraw(200); // 播放时 刷新已播放进度  可以用 百分比 * canvas宽度

参数

          onChange:onChange.bind(this), // 点击canvas调整进度  会返回点击处百分比
          arr: 谱段height数组  [1,2,34,12,3,412,12,41]]
          dom: canvas标签class || id  '.canvas' || '#canvas'

FAQs

Package last updated on 17 Dec 2019

Did you know?

Socket

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