V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
ivmm
V2EX  ›  问与答

求推荐一个能本地无网络运行的 弹幕 HTML5 播放器

  •  
  •   ivmm · 2017-01-04 18:50:24 +08:00 · 3250 次点击
    这是一个创建于 2660 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这里的本地:不建设 web 软件的情况,意味着没有 localhost , 127.0.0.1 ,就是 file://

    DIYGOD 的 Dplayer 的弹幕文件一放到本地就不能用了。

    其他的我找到的播放器效果都没 Dplayer 好。。

    13 条回复    2017-01-05 05:46:11 +08:00
    tadtung
        1
    tadtung  
       2017-01-04 19:09:48 +08:00 via Android
    你将播放器 js , css 这些都放在本地不就行了,,本地视频是可以播放的。。。
    当然我主要用 ckplayer
    yexm0
        2
    yexm0  
       2017-01-04 19:22:44 +08:00 via Android
    BiliLocal 不知道行不行
    whwq2012
        3
    whwq2012  
       2017-01-04 19:23:57 +08:00 via Android
    弹弹 play ,不过 windows 下才能用
    ivmm
        4
    ivmm  
    OP
       2017-01-04 19:55:22 +08:00
    @tadtung

    放在本地,肯定的嘛。 视频可以播放,但是弹幕不行~
    ckplayer 貌似不错


    @yexm0 @whwq2012 我是打算放在答辩的网页中的。
    tadtung
        5
    tadtung  
       2017-01-04 20:17:59 +08:00 via Android
    @ivmm 他的弹幕数据在服务器上的,,你要自己额外在本地部署弹幕才行。
    ivmm
        6
    ivmm  
    OP
       2017-01-04 20:22:49 +08:00
    @tadtung
    貌似不行啊。

    danmaku: { // Optional, showing danmaku, ignore this option to hide danmaku
    id: '9E2E3368B56CDB58', // Required, danmaku id, NOTICE: it must be unique, can not use these in your new player: `https://api.prprpr.me/dplayer/list`
    api: 'https://api.prprpr.me/dplayer/', // Required, danmaku api
    token: 'tokendemo', // Optional, danmaku token for api
    maximum: 1000, // Optional, maximum quantity of danmaku
    addition: ['https://api.prprpr.me/dplayer/bilibili?aid=6911423'] // Optional, additional danmaku, see: `Bilibili 弹幕支持`
    }

    只要 api: 'https://api.prprpr.me/dplayer/', 无法连通,就不能加载弹幕,也就是说必须部署 web 软件才可以。
    tadtung
        7
    tadtung  
       2017-01-04 20:36:23 +08:00 via Android
    @ivmm 对的,你想离线就得本地部署。
    当然你只是用作答辩,非生产环境,不存在负载问题,可以自己写个简单的弹幕插件。
    ivmm
        8
    ivmm  
    OP
       2017-01-04 20:40:02 +08:00
    @tadtung
    突然想到我部署本地只是为了加载速度快和内容全而已,一个弹幕数据加载应该是很快的,不一定非要本地了(抑制我的强迫症)。
    weizhenye
        9
    weizhenye  
       2017-01-04 21:29:00 +08:00
    https://github.com/weizhenye/Danmaku
    打个广告,一个弹幕引擎库,可能不符合你的要求,不过 demo ( https://danmaku.js.org ) 实现了把 B 站弹幕存到 localStorage 里,支持离线,可以参考一下。
    ivmm
        10
    ivmm  
    OP
       2017-01-04 21:57:44 +08:00
    @weizhenye 兼容 b 站的弹幕格式么?
    ivmm
        11
    ivmm  
    OP
       2017-01-04 22:23:55 +08:00
    @weizhenye

    https://github.com/weizhenye/Danmaku/wiki/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3
    文档里,我硬是没找到
    “// 弹幕数据数组,在 emit API 中会说明其格式
    comments: [],”

    的用法说明
    weizhenye
        12
    weizhenye  
       2017-01-04 23:22:47 +08:00
    @ivmm 弹幕格式就是「发射弹幕」部分 danmaku.emit() 里的对象, comments 就是这个对象的数组。
    B 站的弹幕需要转换后才行, demo 写了一个 https://github.com/weizhenye/Danmaku/blob/gh-pages/parser/bilibili.js
    cnbeining
        13
    cnbeining  
       2017-01-05 05:46:11 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3749 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 05:03 · PVG 13:03 · LAX 22:03 · JFK 01:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.