Changeset 92863 in spip-zone


Ignore:
Timestamp:
Nov 12, 2015, 6:44:16 PM (4 years ago)
Author:
booz@…
Message:

gestion du player 360 : http://www.schillmania.com/projects/soundmanager2/demo/360-player/canvas-visualization.html

Location:
_plugins_/soundmanager
Files:
39 added
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/soundmanager/sm_pipelines.php

    r82354 r92863  
    88// Ajouter soundmanager s'il n'y est pas déjà et qu'on a des enclosures dans la page
    99function sm_affichage_final($page) {
    10 
     10       
    1111        if (!$GLOBALS['html']) return $page;
    1212
     
    1414                if(strpos($page, 'rel="enclosure"')  OR strpos($page, "rel='enclosure'") AND $GLOBALS['html']){                                 
    1515                        $script .= "\n"."<script type=\"text/javascript\" src=\"" . find_in_path('script/soundmanager2.js') . "\"></script>"."\n";
    16                         $script .= "<script type=\"text/javascript\" src=\"" . generer_url_public('soundmanager.js') . "\"></script>"."\n";
     16                        $script .= "<script type=\"text/javascript\" src=\"" . find_in_path('soundmanager.js') . "\"></script>"."\n";
    1717                        $script .= "<link rel='stylesheet' href='" . generer_url_public('soundmanager.css') . "' type='text/css' media='projection, screen, tv' />"."\n";
     18                       
     19                        $page = substr_replace($page, $script, strpos($page, '</head>'), 0);
     20                }
     21                if(strpos($page, 'class="ui360')  OR strpos($page, "class='ui360") AND $GLOBALS['html']){                                       
     22                        $script .= "\n<link rel='stylesheet' href='" . find_in_path('flashblock/flashblock.css') . "' type='text/css' />"."\n";
     23                        $script .= "<link rel='stylesheet' href='" . find_in_path('360-player/360player.css') . "' type='text/css' />"."\n";
     24                        $script .= "<link rel='stylesheet' href='" . find_in_path('360-player/360player-visualization.css') . "' type='text/css' />"."\n";
     25
     26                        $script .= "\n"."<script type=\"text/javascript\" src=\"" . find_in_path('360-player/script/berniecode-animator.js') . "\"></script>"."\n";
     27                        $script .= "\n"."<script type=\"text/javascript\" src=\"" . find_in_path('script/soundmanager2.js') . "\"></script>"."\n";
     28                       
     29                        $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";
     30                        $script .= "\n"."<script type=\"text/javascript\" src=\"" . find_in_path('360-player/script/360player.js') . "\"></script>"."\n";
     31               
     32                       
     33$str = <<<EOD
     34<script type="text/javascript">
     35
     36soundManager.setup({
     37          url: '/plugins/soundmanager/swf/',
     38          flashVersion: 9, // optional: shiny features (default = 8)
     39          useFlashBlock: false, // optionally, enable when you're ready to dive in
     40          debugMode: false
     41});
     42
     43threeSixtyPlayer.config.scaleFont = (navigator.userAgent.match(/msie/i)?false:true);
     44threeSixtyPlayer.config.showHMSTime = true;
     45
     46// enable some spectrum stuffs
     47
     48threeSixtyPlayer.config.useWaveformData = true;
     49threeSixtyPlayer.config.useEQData = true;
     50
     51// enable this in SM2 as well, as needed
     52
     53if (threeSixtyPlayer.config.useWaveformData) {
     54  soundManager.flash9Options.useWaveformData = true;
     55}
     56if (threeSixtyPlayer.config.useEQData) {
     57  soundManager.flash9Options.useEQData = true;
     58}
     59if (threeSixtyPlayer.config.usePeakData) {
     60  soundManager.flash9Options.usePeakData = true;
     61}
     62
     63if (threeSixtyPlayer.config.useWaveformData || threeSixtyPlayer.flash9Options.useEQData || threeSixtyPlayer.flash9Options.usePeakData) {
     64  // even if HTML5 supports MP3, prefer flash so the visualization features can be used.
     65  soundManager.preferFlash = true;
     66}
     67
     68</script>
     69EOD;
     70
     71                        $script .= "\n" . $str ."\n";
    1872                       
    1973                        $page = substr_replace($page, $script, strpos($page, '</head>'), 0);
Note: See TracChangeset for help on using the changeset viewer.