PHP Classes

File: jquery.playSound.js

Recommend this page to a friend!
  Classes of Free Ment   PHP Live Chat Browser   jquery.playSound.js   Download  
File: jquery.playSound.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Live Chat Browser
Live chat with users of the same or another site
Author: By
Last change:
Date: 1 year ago
Size: 1,066 bytes
 

Contents

Class file image Download
/** * @author Alexander Manzyuk <admsev@gmail.com> * Copyright (c) 2012 Alexander Manzyuk - released under MIT License * https://github.com/admsev/jquery-play-sound * Usage: $.playSound('http://example.org/sound') * $.playSound('http://example.org/sound.wav') * $.playSound('/attachments/sounds/1234.wav') * $.playSound('/attachments/sounds/1234.mp3') * $.stopSound(); **/ (function ($) { $.extend({ playSound: function () { alert(arguments); if(arguments[1].length > 0) { id_string = ' id="' + arguments[1] + '"'; } else { id_string = ''; } return $( '<audio' + id_string + ' class="sound-player" autoplay="autoplay" style="display:none;">' + '<source src="' + arguments[0] + '" />' + '<embed src="' + arguments[0] + '" hidden="true" autostart="true" loop="false"/>' + '</audio>' ).appendTo('body'); }, stopSound: function () { $(".sound-player").remove(); } }); })(jQuery);