OCremix player

audio player implementation

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        OCremix player
// @namespace   mod
// @description audio player implementation
// @include     http://ocremix.org/remix/*
// @version     1
// @grant       none
// ==/UserScript==

// get src of mp3
var elm = document.querySelector("#panel-download > ul:nth-child(4) > li:nth-child(1) > a:nth-child(1)");

// dom node to implement the the player
var parent = document.querySelector("#main-content > div:nth-child(1) > div:nth-child(1) > div:nth-child(5) > div:nth-child(1)");

// create audio player node
var html = "<audio controls><source src='" + elm.href + "' type='audio/mp3'></audio>";
var div = document.createElement("div");
div.innerHTML = html;

// append to DOM
parent.insertBefore(div,parent.firstChild);