Giter VIP home page Giter VIP logo

mp3_player's Introduction

Mp3Player

Here’s an mp3_player plugin for Rails. Check out handyrailstips.com/tips/7-playing-mp3-s-on-your-rails-site-with-mp3_player for more info

To install: script/plugin install git://github.com/GavinM/mp3_player.git

To setup: script/generate mp3_player [name of your mp3 directory]

This adds ‘player.swf’ to public/ and creates a new folder for storing all of your audio files.

Example Usage

To play an mp3 file found in public/mp3s/mysong.mp3 simply add <%= mp3_player(“mp3s/mysong.mp3”) %> to your view.

If you’re using paperclip: <%= mp3_player @my_model.mp3.url %>.

Below is a list of the extra options you can specify: (All colors should be expressed as hexadecimal values minus the ‘#’. eg. <%= mp3_player @my_model.mp3.url, :bg => “99FFFF”) %>

:width

width of the player when open in pixels, defaults to 290

:class

class of the div wrapping the player, defaults to “mp3_player”

:bg

background colour, defaults to “BBBBBB”

:left_bg

background colour of the left tab, defaults to “AAAAAA”

:right_bg

background colour of the right tab, defaults to “AAAAAA”

:right_bg_hover

colour of the right background as the cursor hovers over, defaults to “EEEEEE”

:left_icon

the colour of the speaker icon on the left, defaults to “222222”

:right_icon

colour of the play/pause icon on the right, defaults to “222222”

:right_icon_hover

colour of the play/pause icon as the cursor hovers over, defaults to “222222”

:text

colour of the text, defaults to “222222”

:slider

colour of the slider bar, defaults to “333333”

:loader

colour of the loaded data so far, defaults to “DDDFFF”

:track

colour of the track on the slider, defaults to “888888”

:border

colour of the buffer border, defaults to “333333”

This plugin is based on the Audio Player Worpress Plugin by Martin Laine www.1pixelout.net/code/audio-player-wordpress-plugin

Thanks to Matt Ittigson (github.com/mattenat) for inspiring changes to help support paperclip.

Copyright © 2009 Gavin Morrice (handyrailstips.com), released under the MIT license

mp3_player's People

Contributors

bodacious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mp3_player's Issues

URI on heroku

I found a little bug though in setting up a site that uses this plugin on heroku. I kept getting something along the lines of "no such file to load 'URI'". It looked through the stack trace and found found that require "URI" was in the view_helper.rb file. I looked up the URI library and all of the examples had "require 'uri'". I tried that and it worked just fine both on my local machine and on the heroku cloud. Don't know why "URI" would work on the local machine but not in the cloud, but there you have it.

In any case, thanks for the great plugin.

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.