Coder Social home page Coder Social logo

bugoo's Introduction

描述

bugoo.js 是一个适用于pc和mobile浏览器的音频播放类库。

特性

  • 暂且只支持mp3音频(其他音频也可放,但不保证质量)
  • 支持HTML5的audio接口使用HTML5播放
  • 一个页面不能同时播放两个音频
  • 不依赖任何前端类库

浏览器支持

  • ie6++ 及 各种现代浏览器
  • 移动端浏览器

###Demo fm

文档

示例

var sound = new Bugoo({
    media: 'sound.mp3', //音频文件的地址(必须)
    swfFile: 'player.swf', //flash文件的地址,不支持audio api的浏览器使用(必须)
    loading: function() {
      //加载时执行的方法
    },
    start: function() {
      //开始播放时执行的方法
    },
    timeupdate: function() {
      //播放过程中执行的方法
    },
    stop: function() {
      //停止时执行的方法
    }
});
立即播放:
var sound = new Bugoo({
    media: 'sound.mp3',
    swfFile: 'player.swf'
}).play();
播放
sound.play();
停止
sound.stop();

属性

  • duration: Number 音频的时长(以s为单位)
  • currentTime: Number 当前播放的进度(以s为单位)
  • status: String 播放的状态。有readyloadingplayingpaused(flash没有这个状态)和ended四个返回值。

bugoo's People

Contributors

binnng avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bugoo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.