惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
美团技术团队
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
Martin Fowler
Martin Fowler
Recorded Future
Recorded Future
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
博客园_首页
A
About on SuperTechFans
MongoDB | Blog
MongoDB | Blog
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
B
Blog
The Register - Security
The Register - Security
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
Last Week in AI
Last Week in AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
有赞技术团队
有赞技术团队
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News - Newest:
Hacker News - Newest: "LLM"
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
W
WeLiveSecurity
Latest news
Latest news
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
L
Lohrmann on Cybersecurity
博客园 - Franky
Recent Commits to openclaw:main
Recent Commits to openclaw:main
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - 骨月枫🍁

使用vLLM部署Qwen/Qwen3.5-35B-A3B-FP8并且在DIFY中调用 记录个人数组、字符串自己常忘记的方法,以及ES常用处理方式 解决webpack vue 项目打包生成的文件,资源文件均404问题 js 复制粘贴功能记录 记录下工作中使用的pdf.js js 函数节流 用ajax与fetch调用阿里云免费接口 简要谈谈javascript bind 方法 h5启动原生APP总结 mac上安装mongoDb以及简单使用 mac快捷键整理以及node的基本使用 html5视频video积累 整理下PC和移动获取点击、移动坐标的代码和坑 html5 实现简单的上传 canvas基础学习(四) canvas基础学习(三) canvas基础学习(二) canvas基础学习(一) 移动端使用百度分享代码
记录下jplayer的简单demo
骨月枫🍁 · 2017-09-13 · via 博客园 - 骨月枫🍁

jplay一个播放器的工具包,依赖于jquery或者zepto,有zepto所以相当于是PC和移动都支持。

它的官方文档为:http://www.jplayer.cn/

同时也推出的react的支持包,具体参考:https://github.com/jplayer/react-jPlaylist

所以还是蛮好用的一个工具

以下是自己要使用时,写的个小demo,自己留存以便以后参考

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <script type="text/javascript" src='http://www.jplayer.cn/demos/lib/jquery.min.js'></script>
        <script type="text/javascript" src='http://www.jplayer.cn/demos/dist/jplayer/jquery.jplayer.min.js'></script>
    </head>
    <body>
        <div id="test"></div>
        <div>
            <button id="play">play</button>
            <button id="pause">pause</button>
            <button id="next">next</button>
            <button id="goEnd">goEnd</button>
            <p id="progress">0</p>
        </div>
        <script>
            var musicUrl = "http://ws.stream.qqmusic.qq.com/108709929.m4a?fromtag=46";
            var nextMusicUrl = "http://ws.stream.qqmusic.qq.com/108029927.m4a?fromtag=46";
            $("#test").jPlayer({            //配置音乐源文件,并自动播放
                ready: function() {
                    $(this).jPlayer("setMedia", {
                        mp3: musicUrl
                    }).jPlayer("play");
                } ,
                ended: function() {             //当前音乐结束后触发事件
                    console.log("play end");
                    $(this).jPlayer("setMedia", {
                        mp3: nextMusicUrl
                    }).jPlayer("play");
                } ,
                timeupdate : function(e){        //播放时间更新事件
                    $("#progress").text(parseInt(e.jPlayer.status.currentTime));
                }
            })
            $("#pause").bind("click" , function(){        //暂停
                $("#test").jPlayer("pause");
            });
            $("#play").bind("click" , function(){        //播放
                $("#test").jPlayer("play");
            });
            $("#next").bind("click" , function(){        //下一首
                $("#test").jPlayer("setMedia", {
                            mp3: nextMusicUrl
                        }).jPlayer("play");
            });
            $("#play").bind("click" , function(){        //播放
                $("#test").jPlayer("play");
            });
            $("#goEnd").bind("click" , function(){        //跳转到95%的位置播放
                $("#test").jPlayer("playHead", 95);
            });
        </script>
    </body>
</html>

就这样啦!!!