dongxuanyi3406 2011-11-30 05:11
浏览 28
已采纳

mp3文件无法在Facebox中播放

I am using Facebox. I have to play mp3files in Facebox. I included facebox.js and facebox.css

My view code is:

<script  type="text/javascript">
    $(document).ready(function () {

        $('a[rel*=facebox]').facebox();
    }
</script>

$res= explode('/',$val['audio_file']);

<a href="<?=base_url().'uploads/'.$val['audio_file'];?>" rel="facebox"><?=$res['1'];?></a>

I have to play this mp3 file in Facebox. Is it possible?

I have linked the mp3 file in anchor tag, then can I play that file in a facebox. Now it plays in big screen.

  • 写回答

1条回答 默认 最新

  • dqhgjay5753 2011-12-01 03:45
    关注

    Include it in view

    <script type="javascript">
    
            $('#play').live('click', function(e) {                                           
            e.preventDefault();
            link=this.href;  
            jQuery.facebox({ ajax: link });
            });
    
            </script>
    
    <a id="play" href="<?=site_url('admin/test/playmp3/'.$val['id']);?>"><?=$res['1'];?></a>
    

    Include it in controller

    function playmp3($id)
    {
    $this->data['mp3']  = $this->test_model->getmp3($id);
    $this->load->vars($this->data);
    echo $this->load->view( $this->config->item('APP_template_dir').'admin/playmp3_view');
    }
    

    Create a new page playmp3_view and include it

        <div style="">
        <object type="application/x-shockwave-flash" data="<?=base_url().$this->config->item('APP_assets_admin').'/'.$this->config->item('APP_js');?>/player_mp3.swf" width="200" height="20">
       <param name="movie" value="<?=base_url().$this->config->item('APP_assets_admin').'/'.$this->config->item('APP_js');?>/player_mp3.swf" />
       <param name="FlashVars" value="mp3=<?=base_url().'uploads/'.$mp3->audio_file?>" /></object>
        </div>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路