All Projects → sabrinaluo → react-aplayer

sabrinaluo / react-aplayer

Licence: MIT License
🍭 A React wrapper component of APlayer

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to react-aplayer

Skplayer
🎵 A simple & beautiful HTML5 music player
Stars: ✭ 437 (+1648%)
Mutual labels:  player, music-player, audio-player
pushtape-player.js
Customizable JS audio page player with global playback controls and autoscan (mutationobserver), built on Soundmanager2.
Stars: ✭ 27 (+8%)
Mutual labels:  player, music-player, audio-player
React Cassette Player
Simple ReactJS HTML5 audio player component built with SVG icons from The Noun Project.
Stars: ✭ 93 (+272%)
Mutual labels:  player, music-player, audio-player
mpz
Music player for big local collections
Stars: ✭ 50 (+100%)
Mutual labels:  player, music-player, audio-player
TonUINO
Alternative TonUINO Firmware
Stars: ✭ 112 (+348%)
Mutual labels:  player, music-player, audio-player
Sbplayerclient
支持全格式的mac版视频播放器
Stars: ✭ 110 (+340%)
Mutual labels:  player, music-player, audio-player
Cog
Cog - A Free and Open Source Audio Player for macOS 10.13+
Stars: ✭ 152 (+508%)
Mutual labels:  player, music-player, audio-player
Html Midi Player
🎹 Play and display MIDI files on the web
Stars: ✭ 158 (+532%)
Mutual labels:  player, music-player, audio-player
minimal-player
This is a minimal, clean audio/music/mp3 player with spinning cover images, built with jQuery, TweenMax.js and SVG images.
Stars: ✭ 48 (+92%)
Mutual labels:  player, music-player, audio-player
Swift Radio Pro
Professional Radio Station App for iOS!
Stars: ✭ 2,644 (+10476%)
Mutual labels:  player, music-player, audio-player
SwiftAudioPlayer
[WIP] Simple music player for macOS written in Swift
Stars: ✭ 33 (+32%)
Mutual labels:  player, music-player, audio-player
audioStreamDemo
A music player created in swift using AVPlayer to stream audio from server.
Stars: ✭ 33 (+32%)
Mutual labels:  player, music-player, audio-player
amplyfm
A free and open-source web app for streaming music.
Stars: ✭ 46 (+84%)
Mutual labels:  player, music-player, audio-player
RecPlayer-iOS
A simple iOS application that records audio and plays it back. (+some animations)
Stars: ✭ 21 (-16%)
Mutual labels:  player, audio-player
JetTunes-Desktop-Music-Player
Material design music player made with javafx
Stars: ✭ 36 (+44%)
Mutual labels:  music-player, audio-player
MusicFolderPlayer
An elegant HTML5 web folder player for parties and/or private music collections, with playlist management that's just better.
Stars: ✭ 89 (+256%)
Mutual labels:  music-player, audio-player
deplayer
Decentralized mediaplayer which runs entirely in the browser.
Stars: ✭ 14 (-44%)
Mutual labels:  player, music-player
angular-youtube-player
Simple youtube player created with angular and typescript. See demo.
Stars: ✭ 35 (+40%)
Mutual labels:  player, music-player
simple-cloud-music
简洁的的第三方网易云音乐播放器
Stars: ✭ 306 (+1124%)
Mutual labels:  player, music-player
violin
🎵 Minimalistic music player for desktop devices.
Stars: ✭ 40 (+60%)
Mutual labels:  music-player, audio-player

React-APlayer

npm GitHub tag npm license

🍭 Wow, A react wrapper of the beautiful HTML5 music APlayer

Introduction

Demo

List with lyrics

image

🌟 Fixed Mode

image

Usage

Install

npm install react-aplayer --save

Example

Check src/app.js to get more example;

import React from 'react';
import ReactAplayer from 'react-aplayer';

export default class App extends React.Component {
  // event binding example
  onPlay = () => {
    console.log('on play');
  };

  onPause = () => {
    console.log('on pause');
  };

  // example of access aplayer instance
  onInit = ap => {
    this.ap = ap;
  };

  render() {
    const props = {
      theme: '#F57F17',
      lrcType: 3,
      audio: [
        {
          name: '光るなら',
          artist: 'Goose house',
          url: 'https://moeplayer.b0.upaiyun.com/aplayer/hikarunara.mp3',
          cover: 'https://moeplayer.b0.upaiyun.com/aplayer/hikarunara.jpg',
          lrc: 'https://moeplayer.b0.upaiyun.com/aplayer/hikarunara.lrc',
          theme: '#ebd0c2'
        }
      ]
    };

    return (
      <div>
        <ReactAplayer
          {...props}
          onInit={this.onInit}
          onPlay={this.onPlay}
          onPause={this.onPause}
        />
        {/* example of access aplayer instance API */}
        <button onClick={() => this.ap.toggle()}>toggle</button>
      <div>
    );
  }
}

Props

onInit as a callback function will be invoked when aplayer instance get initialized and with the instance as parameter, through which you can get the full control of aplayer API. see onInit in above example

Other props are exactly the same with original APlayer, please check the docs for more details.

Event Handlers

Event handlers are triggered when corresponding event happens, it takes a callback function as parameter.

All the event handlers in react-aplayer are in a format of captalized event name prefixed with on, e.g. in aplayer, event play will be onPlay in react-aplayer,

Please check the docs for more events.

APlayer Instance

APlayer Instance can be accessed through onInit

LICENSE

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].