Code Monkey home page Code Monkey logo

Comments (6)

cbwang2016 avatar cbwang2016 commented on July 17, 2024

<DPlayer
className={classes.player}
options={{
video: {
url:
getBaseURL() +
(pathHelper.isSharePage(location.pathname)
? "/share/preview/" +
id +
(query.get("share_path") !== ""
? "?path=" +
encodeURIComponent(
query.get("share_path")
)
: "")
: "/file/preview/" + query.get("id"))
}
}}
/>

在这个地方,按照http://dplayer.js.org/guide.html#options 增加

    subtitle: {
        url: 'dplayer.vtt',
        type: 'webvtt',
        fontSize: '25px',
        bottom: '10%',
        color: '#b7daff',
    },

如果能加个设置UI当然最好。不过感觉目前应该可以直接做一个检测然后把同名文件srt, ass等常用后缀加到一个白名单里?

from frontend.

cbwang2016 avatar cbwang2016 commented on July 17, 2024

这个搜寻字幕文件的工作应该不需要后端参与,可以完全在前端完成,所以感觉目前不需要修改任何后端代码?

from frontend.

HFO4 avatar HFO4 commented on July 17, 2024

确实有这个打算加入。但是我记得浏览器原生支持的字幕格式有限,其他常见格式可能还需要后端转换的步骤。

from frontend.

cbwang2016 avatar cbwang2016 commented on July 17, 2024

确实有这个打算加入。但是我记得浏览器原生支持的字幕格式有限,其他常见格式可能还需要后端转换的步骤。

确实是,好像就vtt和ass,ass感觉还是很常用的,感觉可以先放到3.2的roadmap里?

from frontend.

cbwang2016 avatar cbwang2016 commented on July 17, 2024

确实有这个打算加入。但是我记得浏览器原生支持的字幕格式有限,其他常见格式可能还需要后端转换的步骤。

查了一下,后端也许https://github.com/asticode/go-astisub 是个靠谱的选择?

from frontend.

cbwang2016 avatar cbwang2016 commented on July 17, 2024

确实有这个打算加入。但是我记得浏览器原生支持的字幕格式有限,其他常见格式可能还需要后端转换的步骤。

或者也可以考虑前端转换https://github.com/papnkukn/subsrt ?感觉这样方便一些。

from frontend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.