Git Product home page Git Product logo

obsidianplugins-videotimestampprotocol's Introduction

基于URL协议实现视频时间戳

简介

当前标准markdown语法中的视频链接只能打开本地视频,但不能定位到视频中的特定时间戳,部分markdown编辑器实现了时间戳语法但不通用。针对此问题,本项目实现一个自定义URL协议。访问基于此协议编写的本地视频链接时将调用自定义URL协议,用指定播放器打开指定视频并跳转到指定时间戳。效果演示如下: 基于URL协议实现视频时间戳

实现

本项目基于自定义URL协议,所以也是分为注册协议和编写程序两个部分,最后再加上一个应用验证。

注册协议

  • 打开注册表编辑器
  • 计算机\HKEY_CLASSES_ROOT下建立如下的注册表结构(因为要实现视频播放,所以就是一个player,因此这个自定义协议的title也叫player):
  • 在player项下新建字符串值URL Protocol,值是空字符串:
  • 把DefaultIcon项下的默认值改为要调用的语言引擎路径。我们是基于python实现,所以这里写python解释器的路径:
  • 把command项下的默认值改为D:\ProgramFiles\anaconda3\python.exe C:\Users\xuyang\Desktop\a.py %1
  • 至此协议就注册完毕,以后访问“player://E:/a.mp4#12:9”这样的URL时,就会在命令行运行D:\ProgramFiles\anaconda3\python.exe D:\ProgramFiles\playerProtocol\playerProtocol.py %1这样的指令。

编写程序

  • 创建python程序`D:\ProgramFiles\playerProtocol\playerProtocol.py。
  • 程序内容参见

应用验证

效果演示就如前文“简介”所示。这里再加一个实例验证(因为项目是针对本地视频链接,所以放在github上应该就用不了了,这里就是一个示意): 1。

obsidianplugins-videotimestampprotocol's People

Contributors

zhuo-ren avatar

Stargazers

 avatar

Watchers

 avatar

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.