Fandom

Wikia Developers Wiki

ChatMp3InputBox

823pages on
this wiki
Add New Page
Talk7 Share

ChatMp3InputBox allows you to play audio files (MP3, OGG and WAV) in the chat by the URL written in a text field.

Installation

Copy this and paste it into MediaWiki:Chat.js or personal chat.js:

 
var textSound = $('#myText').val();
$('ul.WikiChatList').prepend('<div>Type here the URL of the <abbr style="border-bottom:1px dotted black" title="MP3, OGG & WAV"> audio file</abbr> and press Enter<audio></audio></div><div><input type="text" /></div><a href="//www.google.com/search?q=mp3">Search MP3 files</a>');
$('#playAudio').click(function() {
var audiowtf = document.getElementById("audiowtf"); 
audiowtf.play();
});
 
var audioElement = document.getElementsByTagName('audio')[0];
var inputElement = document.getElementsByTagName('input')[0];
 
$('input').keyup(function() {
  if (event.keyCode == 13) {
    loadAndPlay(inputElement.value);
  }
});
 
function loadAndPlay(src) {
  audioElement.pause();
  audioElement.src = src;
  audioElement.load();
  audioElement.play();
}
 
loadAndPlay(inputElement.value);

To-do list

  • Translate to other languages

Changelog

  • 02/17/2016: 1.1 - Now it's side-wide allowed.
  • 02/16/2016: 1.0.1 - Improving the appearance.
  • 02/16/2016: 1.0 - Launch version

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.