Browse Source

surcharge des evenement du player 360 + fichier spécial

svn/attic/soundmanager/119002
booz@rezo.net 4 years ago
parent
commit
870dc92490
  1. 1
      .gitattributes
  2. 93
      player360.js.html
  3. 47
      sm_pipelines.php

1
.gitattributes

@ -31,6 +31,7 @@ inclure/documents.html -text
modeles/audio.html -text
modeles/doc.html -text
/paquet.xml -text
/player360.js.html -text
/plugin.xml -text
script/inlineplayer.js -text
script/soundmanager2-jsmin.js -text

93
player360.js.html

@ -0,0 +1,93 @@
#HTTP_HEADER{Content-Type: text/javascript}
#CACHE{24*3600,cache-client}
soundManager.setup({
url: '[(#CHEMIN{swf/soundmanager2.swf}|url_absolue|dirname)/]',
flashVersion: 9, // optional: shiny features (default = 8)
useFlashBlock: false, // optionally, enable when you're ready to dive in
debugMode: false
});
threeSixtyPlayer.config.scaleFont = (navigator.userAgent.match(/msie/i)?false:true);
threeSixtyPlayer.config.showHMSTime = true;
// enable some spectrum stuffs
threeSixtyPlayer.config.useWaveformData = true;
threeSixtyPlayer.config.useEQData = true;
// enable this in SM2 as well, as needed
if (threeSixtyPlayer.config.useWaveformData) {
soundManager.flash9Options.useWaveformData = true;
}
if (threeSixtyPlayer.config.useEQData) {
soundManager.flash9Options.useEQData = true;
}
if (threeSixtyPlayer.config.usePeakData) {
soundManager.flash9Options.usePeakData = true;
}
if (threeSixtyPlayer.config.useWaveformData || threeSixtyPlayer.flash9Options.useEQData || threeSixtyPlayer.flash9Options.usePeakData) {
// even if HTML5 supports MP3, prefer flash so the visualization features can be used.
soundManager.preferFlash = true;
}
$(document).ready(function(){
function maj_bouton_play_pause(){
if($("button.play_pause").text() === "pause"){
$("button.play_pause").html("play") ;
}else{
$("button.play_pause").html("pause") ;
}
}
// surcharge des events play/pause/finish : https://stackoverflow.com/questions/10127009/soundmanager2-onplay-event-configuration-does-not-work
var onplay360 = threeSixtyPlayer.events.play;
var myOnplay = function(){
//console.log("play");
maj_bouton_play_pause();
onplay360.apply(this); // forces the scope to 'this' = the sound object
};
threeSixtyPlayer.events.play = myOnplay;
var onpause360 = threeSixtyPlayer.events.pause;
var myOnpause = function(){
//console.log("pause");
maj_bouton_play_pause();
onpause360.apply(this); // forces the scope to 'this' = the sound object
};
threeSixtyPlayer.events.pause = myOnpause;
var onresume360 = threeSixtyPlayer.events.resume;
var myOnresume = function(){
//console.log("resume");
maj_bouton_play_pause();
onresume360.apply(this); // forces the scope to 'this' = the sound object
};
threeSixtyPlayer.events.resume = myOnresume;
var onfinish360 = threeSixtyPlayer.events.finish;
var myOnfinish = function(){
//console.log("finish");
maj_bouton_play_pause();
onfinish360.apply(this); // forces the scope to 'this' = the sound object
};
threeSixtyPlayer.events.finish = myOnfinish;
// y'a t'il un son ?
if($(".ui360").size() > 0){
$("button.play_pause").click(function(){
// son déjà chargé ?
if(typeof soundManager.getSoundById("ui360Sound0") == "undefined"){
$(".sm2-360btn").eq(0).click();
}else{
soundManager.togglePause("ui360Sound0");
}
});
}
});

47
sm_pipelines.php

@ -15,66 +15,25 @@ function sm_affichage_final($page) {
$page = substr_replace($page, $script, strpos($page, '</head>'), 0);
}
if(strpos($page, 'class="ui360') OR strpos($page, "class='ui360") AND $GLOBALS['html']){
$script .= "<link rel='stylesheet' href='" . find_in_path('360-player/360player.css') . "' type='text/css' />"."\n";
$script .= "<link rel='stylesheet' href='" . find_in_path('360-player/360player-visualization.css') . "' type='text/css' />"."\n";
$script .= "\n"."<script type=\"text/javascript\" src=\"" . find_in_path('360-player/script/berniecode-animator.js') . "\"></script>"."\n";
$script .= "\n"."<script type=\"text/javascript\" src=\"" . find_in_path('script/soundmanager2.js') . "\"></script>"."\n";
$script .= "\n". "<!-- special IE-only canvas fix -->" . "\n". "<!--[if IE]><script type=\"text/javascript\" src=\"" . find_in_path('360-player/script/excanvas.js') . "\"></script><![endif]-->"."\n";
$script .= "\n"."<script type=\"text/javascript\" src=\"" . find_in_path('360-player/script/360player.js') . "\"></script>"."\n";
$str = <<<EOD
<script type="text/javascript">
soundManager.setup({
url: '/plugins/soundmanager/swf/',
flashVersion: 9, // optional: shiny features (default = 8)
useFlashBlock: false, // optionally, enable when you're ready to dive in
debugMode: false
});
threeSixtyPlayer.config.scaleFont = (navigator.userAgent.match(/msie/i)?false:true);
threeSixtyPlayer.config.showHMSTime = true;
// enable some spectrum stuffs
threeSixtyPlayer.config.useWaveformData = true;
threeSixtyPlayer.config.useEQData = true;
// enable this in SM2 as well, as needed
if (threeSixtyPlayer.config.useWaveformData) {
soundManager.flash9Options.useWaveformData = true;
}
if (threeSixtyPlayer.config.useEQData) {
soundManager.flash9Options.useEQData = true;
}
if (threeSixtyPlayer.config.usePeakData) {
soundManager.flash9Options.usePeakData = true;
}
if (threeSixtyPlayer.config.useWaveformData || threeSixtyPlayer.flash9Options.useEQData || threeSixtyPlayer.flash9Options.usePeakData) {
// even if HTML5 supports MP3, prefer flash so the visualization features can be used.
soundManager.preferFlash = true;
}
</script>
EOD;
$script .= "\n" . $str ."\n";
$script .= "<script type=\"text/javascript\" src=\"" . generer_url_public('player360.js') . "\"></script>"."\n";
$page = substr_replace($page, $script, strpos($page, '</head>'), 0);
}
}
return $page;
}
/**
* Ajout d'un rel="enclosure" sur les liens mp3.
* Permet de traiter les [mon son->http://monsite/mon_son.mp3] dans un texte.

Loading…
Cancel
Save