Giter Club home page Giter Club logo

traxplayer's Introduction

Javascript Trax Player

About

This repository is an attempt to recreate the Trax Player originally a Flash(.swf) embedded element as seen below in pure Javascript.

TraxPlayer

At the moment its working and its looking like this.

TraxPlayer

How to use

Data

Your API Should return something like this data

status=0&name=Too lost in the lido&author=Patrick&track1=317,4;408,7;0,1;410,16;413,4;406,4;410,8;412,4&track2=0,2;321,2;443,22;91,2;317,8;443,8;412,2;0,2&track3=0,3;320,2;0,7;414,4;445,4;412,2;323,2;412,4;96,2;412,2;414,4;445,7;448,1;317,4&track4=0,3;324,2;0,6;448,1;0,6;96,2;322,4;96,2;99,2;322,4;412,2;0,2;322,2;96,2;322,2;0,1;324,2;0,3

The data should be based on the dynamic values probably in a database somewhere. If your trax is a single string your need to split out the string into the different tracks. The different tracks can be sepereated by the semicolons and their track number.

Embed the stylesheet

<link href="css/style.css" rel="stylesheet">

Add the HTML

<div class="trax-player" id="trax-player">
    <div class="display">
        <div class="loading"></div>
        <div class="display-inner">
            <div class="title"></div>
            <div class="author"></div>
            <div class="time"><span class="length"></span></div>
        </div>

    </div>
    <div class="control">
        <button class="play-btn" onClick={_traxPlayer.Play()}>Play</button>
    </div>
    <div class="volumecontainer">
        <div class="volume-indicator">
            <div class="volume-indicator-filled">
                <div class="volume-indicator-filled-bg"></div>
            </div>
        </div>
        <input type="range" min="0" max="100" value="50" class="volume">
    </div>
    <div class="music-activity"></div>
</div>

Springle some javacript on it

var _traxPlayer = new TraxPlayer("SONGURL", "DIRECTORY_FOR_MP3"); 

(async () => {
    await _traxPlayer.Preload();
})()
.catch(error => {
    console.log(error);
});

Web-Component

Use: blob/main/web-component/release/habbo-traxplayer.es.js

<script src="./web-component/release/habbo-traxplayer.es.js" type="text/javascript"></script>
<habbo-traxplayer sampleUrl="DIRECTORY_FOR_MP3" songUrl="URL_FOR_SONG" />

traxplayer's People

Contributors

quackster avatar webbanditten avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.