denar90/yii2-wavesurfer-audio-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

denar90/yii2-wavesurfer-audio-widget

最新稳定版本:v1.0

Composer 安装命令:

composer require denar90/yii2-wavesurfer-audio-widget

包简介

Wavesurfer audio widget for yii2.

README 文档

README

Audio widget for yii2 based on wavesurfer.js

Installation

The preferred way to install this extension is through composer.

  • Either run
php composer.phar require --prefer-dist "denar90/yii2-wavesurfer-audio-widget": "dev-master"

or add

"denar90/yii2-wavesurfer-audio-widget": "dev-master"

to the require section of your application's composer.json file.

Usage

In your view add

use denar90\waveSurferAudio\WaveSurferAudioWidget;

In place where you need widget to be shown add

echo WaveSurferAudioWidget::widget([
	'settings' => [
		'fileUrl' => url_to_your_mp3_file,
		'init' => [
			'container' => 'selector_name' //it has to be id not class
		],
		'callbacks' => [
			'ready' => new \yii\web\JsExpression("function(event) {
				this.play();
			}")
		],
		'controls' => [
			'play' => true,
			'pause' => true
		]
	]
]);

Options

Init options sets in init array. List of options

Supported javascript callbacks sets in callbacks array

  • error – Occurs on error. Callback will receive (string) error message.
  • finish – When it finishes playing.
  • loading – Fires continuously when loading via XHR or drag'n'drop.
  • mouseup - When a mouse button goes up.
  • pause – When audio is paused.
  • play – When play starts.
  • ready – When audio is loaded, decoded and the waveform drawn.
  • scroll - When the scrollbar is moved.
  • seek – On seeking.

Supported controls sets in controls array

  • playPause - Plays if paused, pauses if playing.
  • play - Starts playback from the current position. Optional start and end measured in seconds can be used to set the range of audio to play.
  • pause - Stops playback.
  • back - Rewind skipLength seconds.
  • forth - Skip ahead skipLength seconds.
  • toggleMute - Toggles the volume on and off.
  • toggleInteraction - Toggle mouse interaction.
  • toggleScroll - Toggles scrollParent.

统计信息

  • 总下载量: 536
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-14