Git Product home page Git Product logo

ol-mpv's Introduction

ol-mpv

org hyperlink for various video timestamps. It provides link type that can specify time stamp of the video.

Features

This only supports :follow functionality.

I’ve tried to implement :export before, but I’m ending up with giving up as there’s no way to access property drawer in export phase.

If you have good idea for support them, please open new issue and let me know.

Usage

1. Set up URI in property

ol-mpv uses OL_MPV_URI property with it. Set it to URI that you want to associated with:

* Some headline
:PROPERTIES:
:OL_MPV_URI: https://www.youtube.com/watch?v=mtbAUMzBWbE
:END:

2. Write timestamp as link

Then, you can write timestamp as a link. You can write it just like you do in YouTube comment.

mpv:01:00

mpv:01:00
[[mpv:01:00][Link at 1 minute]]
[[mpv:01][Link at 1 second]]
[[mpv:01:00:00][Link at 1 hour]]
[[mpv:1:00][Link at 1 minute without first 0]]
[[mpv:1][Link at 1 second without first 0]]
[[mpv:1:00:00][Link at 1 hour without first 0]]

3. Spawn mpv by open any link in there first time

When you open the link with help:org-open-at-point, it will spawn mpv if it’s not spawned yet.

4. open link to change time position

When you open the link next time, it will change time position.

Supported video URIs

As this program uses mpv directly, all URIs supported by mpv are available (not tested though).

For example:

  • https://
  • file:// (*this is discouraged, use normal path instead)
  • rtmp://
  • fd://

for list of all files, please execute the command below:

mpv --list-protocols | grep '://$' | sort | uniq

or visit https://mpv.io/manual/master/#protocols

For debugging

If you have some problem with mpv, you might better to investigate its output.

To do so, replace :buffer property of make-process with some buffer, and remove ~”–no-terminal”~ Option from :command. (You can use string instead of buffer object, in which case it’ll create buffer with that name if it isn’t exist yet.)

  (let ((mpv-proc (make-process
		:name (format "ol-mpv mpv [%s]" video-uri)
- 	      :buffer nil
+ 	      :buffer "BUFFER_NAME_YOU_WANT"
		:sentinel 'ol-mpv/mpv/sentinel
		:connection-type 'pipe
		:command `("mpv"
- 			 "--no-terminal"
			   ,(format "--title=%s" (ol-mpv/mpv-WM-title video-uri))
			   "--no-input-terminal"
			   "--input-ipc-client=fd://0"
			   ,video-uri
			   ))))

This patch is for version 1.0.0, it might be changed in the future.

ol-mpv's People

Contributors

cj-bc avatar

Watchers

 avatar

ol-mpv's Issues

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.