? .DS_Store ? audiofield.patch ? mediaicons/.DS_Store ? players/.DS_Store Index: audiofield.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mediafield/audiofield.module,v retrieving revision 1.5.2.1 diff -u -F^f --binary -r1.5.2.1 audiofield.module --- audiofield.module 10 Feb 2007 15:18:04 -0000 1.5.2.1 +++ audiofield.module 17 Feb 2007 16:46:09 -0000 @@ -302,6 +302,22 @@ function audiofield_field_formatter_info 'label' => t('Default'), 'field types' => array('file_audio'), ), + '1pixelout' => array( + 'label' => t('1 Pixel Out player'), + 'field types' => array('file_audio'), + ), +/* 'xsfp' => array( + 'label' => t('XSFP player'), + 'field types' => array('file_audio'), + ), + 'xsfp_full' => array( + 'label' => t('XSFP player (full)'), + 'field types' => array('file_audio'), + ), */ + 'button' => array( + 'label' => t('Button player'), + 'field types' => array('file_audio'), + ), ); return $formatters; } @@ -313,8 +329,9 @@ function audiofield_field_formatter($fie if (!isset($item['fid'])) { return ''; } + require_once(drupal_get_path('module', 'audiofield') .'/multimediafile.inc'); $file = _field_file_load($item['fid']); - return theme('audiofield', $file, $item, $filed); + return theme("audiofield_$formatter", $file, $item, $filed); } /** @@ -409,7 +426,7 @@ function theme_audiofield_icon($file) { /** * Themed output for audiofield on a node view page. Called from formatter hook. */ -function theme_audiofield($file, $item, $field) { +function theme_audiofield_default($file, $item, $field) { $file = (array)$file; if (is_file($file['filepath'])) { if ($file['fid'] == 'upload') { @@ -430,3 +447,46 @@ function theme_audiofield($file, $item, return $info; } } + + +function theme_audiofield_1pixelout($file, $item, $field) { + global $base_url; + + $options['soundFile'] = check_url($base_url .'/'. $file['filepath']); + $url = $base_url .'/'. drupal_get_path('module', 'audiofield') .'/players/1pixelout.swf'; + + $flashvars = array(); + foreach ($options as $key => $val) { + $flashvars[] = rawurlencode($key) .'='. rawurlencode($val); + } + $flashvars = implode('&', $flashvars); + +$output = << + + + + + + +EOT; + + return $output; +} + +function theme_audiofield_button($file, $item, $field) { + $options['song_url'] = check_url($base_url .'/'. $file['filepath']); + $options['song_title'] = check_plain($file['description']); + global $base_url; + $url = $base_url .'/'. drupal_get_path('module', 'audiofield') .'/players/button.swf?'. drupal_query_string_encode($options); + +$output = <<'; + + + + +EOT; + + return $output; +} \ No newline at end of file Index: players/parameters.as =================================================================== RCS file: players/parameters.as diff -N players/parameters.as --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ players/parameters.as 17 Feb 2007 16:46:09 -0000 @@ -0,0 +1 @@ +/* Copyright (c) 2005, Fabricio Zuardi All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ //autoload = "true"; //autoplay = true; //[Deprecation Note] (repeat_url not supported anymore) //repeat = "true"; //song_url = "http://downloads.betterpropaganda.com/music/Imperial_Teen-Ivanka_128.mp3"; //song_title = "Imperial Teen - Ivanka"; //song_url = "http://200.199.201.188/trama/tramavirtual/musicas/m_3/19105.mp3"; //song_title = "Eletrofan - Medicine"; //playlist_size = "3"; //first_track = "13"; //shuffle = "true"; //buttons = "http://musicplayer.sourceforge.net/button/load_btn_test.swf,http://musicplayer.sourceforge.net/button/play_btn_test.swf,http://musicplayer.sourceforge.net/button/stop_btn_test.swf,http://musicplayer.sourceforge.net/button/error_btn_test.swf" b_bgcolor = "000000" b_fgcolor = "336600" b_colors = "000000,,000566,ff0000" //playlist_url = "http://webjay.org/by/hideout/allshows.xspf"; //playlist_url = "http://webjay.org/by/chromegat/hipstrumentals28notelevatormuzak29.xspf" //playlist_url = "http://webjay.org/by/hideout/errortest.xspf"; //playlist_url = "http://webjay.org/by/hideout/moviequotes.xspf"; //TODO (backward compatibility: //player_title = "customizeable title test" \ No newline at end of file