zoukankan      html  css  js  c++  java
  • Jplayer用法

    引用js:jquery.jplayer.min.js;

    body里面必须有这个:

    <div id="jplayer"></div>

    jplayer停止方法

    function jpclear() {
    $("#jplayer").jPlayer("clearMedia");
    $("#jplayer").jPlayer("stop");
    $("#jplayer").unbind($.jPlayer.event.ended);
    $("#jplayer").unbind($.jPlayer.event.progress);
    }

    jplayer开始方法

    function jpstart(){
    $("#jplayer").jPlayer({
    swfPath: "js",
    wmode: "window",
    supplied: "mp3",
    preload: "none",
    volume: "1"
    });
    $("#jplayer").jPlayer("setMedia", {
    mp3: mp3
    }).jPlayer("play");
    }

    点击试听

      //试听
      $(".ext_btn_listen").live("click",function() {        $(this).parent().parent().siblings().find('.ext_btn_listen').val('试听');
        var mp3 = $(this).attr('dvideo');
     // var mp3='20150901/55e50a7848625.mp3';
        if(!mp3){alert("请上传音频");}
        else
        {
            
             mp3 = "../uploads/" + mp3;   
            if($(this).val()=='试听'){
                $(this).val('停止');
                $("#jplayer").jPlayer({
                swfPath: "js",
                wmode: "window",
                supplied: "mp3",
                preload: "none",
                volume: "1"
              });
                $("#jplayer").jPlayer("setMedia", {
                    mp3: mp3
                }).jPlayer("play");
                
            }else{
                $(this).val('试听');
                jpclear();
            }
            
        }
      });
  • 相关阅读:
    常用词汇短语
    Java中的数据结构
    Java中的设计模式
    .NET中的编译、程序调用
    常用口语
    0. Angular框架原理
    茶叶
    NPOI自定义单元格背景颜色
    ASP.NET MVC添加Action就找不到
    navicat for mysql 导入SQL Server显示中文乱码解决办法
  • 原文地址:https://www.cnblogs.com/blueskycc/p/4828144.html
Copyright © 2011-2022 走看看