OCremix player

audio player implementation

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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);