JSFiddle - React, Tailwind, and code Playground
by vijayweb
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Example code to create a simple player using jPlayer 2.1.0 -->
<!-- Skins are defined in CSS. Uncomment the following CSS reference and comment out the one below it to switch skins -->
<link href="http://jplayer.org/latest/skin/pink.flag/jplayer.pink.flag.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://jplayer.org/2.1.0/js/jquery.jplayer.min.js"></script>
<script type="text/javascript">
/*paste or reference your JS here*/
</script>
</head>
<body>
<a class="song" href="https://s3-ap-southeast-1.amazonaws.com/g8media/01TRACK.mp3">this song</a>
<br><br>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-single">
<div class="jp-gui jp-interface">
<ul class="jp-controls">
<!-- comment out any of the following <li>s to remove these buttons -->
<li><a href="https://s3-ap-southeast-1.amazonaws.com/g8media/GFans/a002CHANTABBAY(chi)/02+Atlanti+Itlanti.mp3" class="jp-play" tabindex="1">play</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
<li><a href="javascript:;" class="jp-volume-max"...
JavaScript
$('.jp-play').click(function() {
var playthissong = $(this).attr("href");
$(document).ready(function() {
$("#jquery_jplayer_1").jPlayer({
ready: function(event) {
$(this).jPlayer("setMedia", {
mp3: playthissong
});
},
swfPath: "http://www.jplayer.org/2.1.0/js",
supplied: "mp3"
});
}); });