Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $("#jquery_jplayer_1").jPlayer({
- ready: function (event) {
- var data = $.ajax({
- url: "../php/radiostream.php?id="+ potok,
- async: false
- }).responseText;
- var string = data.split('|');
- $('.strem_title').html(string[1]);
- document.getElementById('img_stream_radio').src = ''+ string[2] +'';
- document.getElementById('url_stream_radio').href = ''+ string[3] +'';
- player_ready = true;
- $(this).jPlayer('setMedia', { mp3: string[0] });
- },
- pause: function() {
- $(this).jPlayer('clearMedia');
- },
- error: function(event) {
- if (player_ready && event.jPlayer.error.type === $.jPlayer.error.URL_NOT_SET) {
- $(this).jPlayer('setMedia', { mp3: string[0] }).jPlayer('play');
- } else {
- }
- },
- swfPath: "../jsplayer",
- supplied: "mp3",
- solution:"html, flash",
- preload: "none",
- wmode: "window",
- keyEnabled: true
- });
- $('.play-radio').bind('click', function() {
- var key = $(this).attr('data-stream');
- var potok = $(this).attr('data-potok');
- var data = $.ajax({
- url: "../php/radiostream.php?id="+ potok,
- async: false
- }).responseText;
- var string = data.split('|');
- document.getElementById('img_stream_radio').src = ''+ string[2] +'';
- $('.strem_title').html(string[1]);
- //$('.carousel img').removeClass('active');
- //$(this).addClass('active');
- $('#jquery_jplayer_1').jPlayer('clearMedia');
- $('#jquery_jplayer_1').jPlayer('setMedia', { mp3: string[0] }).jPlayer('play');
- return false;
- });
- var mPlayer = $("#jquery_jplayer_1"),
- options = {
- volumechange: function(event) {
- if(event.jPlayer.options.muted) {
- myControl.volume.slider("value", 0);
- } else {
- myControl.volume.slider("value", event.jPlayer.options.volume);
- }
- },
- cssSelectorAncestor: "#jp_container_1"
- }
- myControl = {
- volume: $(options.cssSelectorAncestor + " .jp-volume-slider")
- };
- $('.jp-gui ul li').hover(
- function() { $(this).addClass('u-state-hover'); },
- function() { $(this).removeClass('u-state-hover'); }
- );
- myControl.volume.slider({
- animate: "fast",
- max: 1,
- range: "min",
- step: 0.01,
- value : $.jPlayer.prototype.options.volume,
- superslide: function(event, ui) {
- mPlayer.jPlayer("option", "muted", false);
- mPlayer.jPlayer("option", "volume", ui.value);
- }
- });
- $('#player a.jp-play').bind('click', function() {
- $('#player .song').html(player_loading);
- return false;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment