Coder Social home page Coder Social logo

yuchen-lea / org-media-note Goto Github PK

View Code? Open in Web Editor NEW
227.0 227.0 33.0 38.4 MB

Taking interactive notes when watching videos or listening to audios in org-mode.

License: GNU General Public License v3.0

Emacs Lisp 100.00%
audio note-taking org-mode video

org-media-note's Introduction

Hi there 👋

My life is mainly governed by the interest in cognition 🧠 and the pity for the suffering ❤ . Here's what's top of my mind:

  • How to represent knowledge?
  • How do we learn? How can we learn better?

At the practical level, I'd like to make some contributions for:

  • Building tools for thought
    • 🎬 Take notes for videos and audios: org-media-note This is an Emacs package support both online and local media, if you want to annotate videos and jump to corresponding postion during review, give it a try!
    • 📖 Extract annots from pdf file: pdfhelper A command line tool to extract annots from pdf. TOC import and export are also supported. If you're an emacser, try org-noter-plus.
  • Using technology to support learning
    • I have been working as product manager in Edtech companies for years, with the belief that we could make the world a better place through technology and education.
    • I'm trying to achieve this by:
      • Design good interactions to make the learning process easy and fun.
      • Utilize data to provide learners with the most suitable learning stuff.

Github Stats Most Used Languages

org-media-note's People

Contributors

emacsbliss avatar et2010 avatar legalnonsense avatar progfolio avatar promisedlandt avatar yuchen-lea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

org-media-note's Issues

example org file

not sure how this works with org-ref, tried inserting a org-ref cite entry in the org file, but the package seems not pick the media file for that..

it would be quite helpful if you could also share an example org mode file .

thanks for creating the package!

Code style

Running flymake or flycheck mode (in combination with checkdoc) will prevent errors and keep code consistent with the elisp style guide.

See: #21

undefined function org-attach-dir

My Doom Emacs versions:

GNU Emacs     v28.1            nil
Doom core     v3.0.0-dev       HEAD -> master, origin/master 1b8f46c7c 2022-05-27 03:13:00 +0200
Doom modules  v22.05.0-dev     HEAD -> master, origin/master 1b8f46c7c 2022-05-27 03:13:00 +0200

Tried installing according to README, but got the following error:

Symbol’s function definition is void: org-attach-dir

Did I miss dependencies?

Adding videos to bib file

Hello Yuchen,

in the readme you mention "quick open related media file in org-ref note (file path is got from bib file)".

I can not figure out how to add a local video file to the bib file. Could you give me a quick description of how you do it, please?
I understand it's not a problem with org-media-note, but I did not know how I can contact you otherwise.

void-function org-link-edit--link-data

It seems org-media-note-adjust-timestamp-offset would call a void function org-link-edit--link-data. I wonder whether the function is native?

my org version: Org mode version 9.4.6 (release_9.4.6-598-g604bfd)

debug info:

Debugger entered--Lisp error: (void-function org-link-edit--link-data)
  (org-link-edit--link-data)
  (let* ((--cl-var-- (org-link-edit--link-data)) (_ (nth 0 --cl-var--)) (_ (nth 1 --cl-var--)) (link (nth 2 --cl-var--)) (_ (nth 3 --cl-var--))) (let* ((splitted (split-string link "#")) (timestamps (split-string (nth 1 splitted)))) (setq current-link-position (org-timer-hms-to-secs (nth 0 timestamps))) (setq offset (- current-playing-position current-link-position))))
  (let* ((current-playing-position (mpv-get-playback-position)) link current-link-position offset) (let* ((--cl-var-- (org-link-edit--link-data)) (_ (nth 0 --cl-var--)) (_ (nth 1 --cl-var--)) (link (nth 2 --cl-var--)) (_ (nth 3 --cl-var--))) (let* ((splitted (split-string link "#")) (timestamps (split-string (nth 1 splitted)))) (setq current-link-position (org-timer-hms-to-secs (nth 0 timestamps))) (setq offset (- current-playing-position current-link-position)))) (save-excursion (org-narrow-to-subtree) (goto-char (point-min)) (while (re-search-forward org-media-note--timestamp-pattern nil t) (let* ((beg (match-beginning 1)) (end (match-end 1)) (hms (buffer-substring beg end)) (adjusted-hms (org-media-note--seconds-to-hms (+ ... offset)))) (goto-char beg) (delete-region beg end) (insert adjusted-hms))) (widen)))
  org-media-note-adjust-timestamp-offset()
  eval((org-media-note-adjust-timestamp-offset) t)
  eval-expression((org-media-note-adjust-timestamp-offset) nil nil 127)
  funcall-interactively(eval-expression (org-media-note-adjust-timestamp-offset) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)
  read-from-minibuffer("M-x " nil (keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) keymap (36 . ivy-magic-read-file-env) (3 keymap (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . hydra-ivy/body) (22 . ivy-scroll-up-command) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . ivy-reverse-i-search) (remap keymap (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . ivy-alt-done) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . ivy-dispatching-done) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil counsel-M-x-history)
  #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x157a07c8fda9>)("M-x " ("edebug-defun" "debug" "toggle-debug-on-error" "org-media-note-hydra/body" "list-processes" "customize-group" "ivy-posframe-mode" "helm-bibtex" "emojify-mode" "orb-note-actions" "deft" "orb-insert-link" "org-noter" "package-delete" "+rime-convert-string-at-point" "org-timeline-export-to-html" "lispy-mode" "org-roam-capture" "lisp-interaction-mode" "package-refresh-contents" "package-install" "ibuffer" "org-publish" "mc/edit-lines" "eaf-open-browser" "org-roam-dailies-capture-today" "load-theme" "magit-todos-mode" "mc/mark-all-dwim" "mc/mark-all-like-this" "package-list-packages" "company-mode" "my-copy-simple" "org-roam-db-sync" "org-version" "describe-font" "org-ql-search" "org-roam-setup" "forward-paragraph" "pdf-tools-install" "eli/push-to-gitpage" "variable-pitch-mode" "org-roam-bibtex-mode" "toggle-truncate-lines" "emacs-lisp-macroexpand" "flyspell-mode" "org-roam-tag-add" "pdf-tools-uninstall" "org-html-htmlize-generate-css" "wttrin-cancel-display-in-mode-line" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x157a07c8fda9>) ("M-x " ("edebug-defun" "debug" "toggle-debug-on-error" "org-media-note-hydra/body" "list-processes" "customize-group" "ivy-posframe-mode" "helm-bibtex" "emojify-mode" "orb-note-actions" "deft" "orb-insert-link" "org-noter" "package-delete" "+rime-convert-string-at-point" "org-timeline-export-to-html" "lispy-mode" "org-roam-capture" "lisp-interaction-mode" "package-refresh-contents" "package-install" "ibuffer" "org-publish" "mc/edit-lines" "eaf-open-browser" "org-roam-dailies-capture-today" "load-theme" "magit-todos-mode" "mc/mark-all-dwim" "mc/mark-all-like-this" "package-list-packages" "company-mode" "my-copy-simple" "org-roam-db-sync" "org-version" "describe-font" "org-ql-search" "org-roam-setup" "forward-paragraph" "pdf-tools-install" "eli/push-to-gitpage" "variable-pitch-mode" "org-roam-bibtex-mode" "toggle-truncate-lines" "emacs-lisp-macroexpand" "flyspell-mode" "org-roam-tag-add" "pdf-tools-uninstall" "org-html-htmlize-generate-css" "wttrin-cancel-display-in-mode-line" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x))
  ivy-posframe--read(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x157a07c8fda9>) "M-x " ("edebug-defun" "debug" "toggle-debug-on-error" "org-media-note-hydra/body" "list-processes" "customize-group" "ivy-posframe-mode" "helm-bibtex" "emojify-mode" "orb-note-actions" "deft" "orb-insert-link" "org-noter" "package-delete" "+rime-convert-string-at-point" "org-timeline-export-to-html" "lispy-mode" "org-roam-capture" "lisp-interaction-mode" "package-refresh-contents" "package-install" "ibuffer" "org-publish" "mc/edit-lines" "eaf-open-browser" "org-roam-dailies-capture-today" "load-theme" "magit-todos-mode" "mc/mark-all-dwim" "mc/mark-all-like-this" "package-list-packages" "company-mode" "my-copy-simple" "org-roam-db-sync" "org-version" "describe-font" "org-ql-search" "org-roam-setup" "forward-paragraph" "pdf-tools-install" "eli/push-to-gitpage" "variable-pitch-mode" "org-roam-bibtex-mode" "toggle-truncate-lines" "emacs-lisp-macroexpand" "flyspell-mode" "org-roam-tag-add" "pdf-tools-uninstall" "org-html-htmlize-generate-css" "wttrin-cancel-display-in-mode-line" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  apply(ivy-posframe--read #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x157a07c8fda9>) ("M-x " ("edebug-defun" "debug" "toggle-debug-on-error" "org-media-note-hydra/body" "list-processes" "customize-group" "ivy-posframe-mode" "helm-bibtex" "emojify-mode" "orb-note-actions" "deft" "orb-insert-link" "org-noter" "package-delete" "+rime-convert-string-at-point" "org-timeline-export-to-html" "lispy-mode" "org-roam-capture" "lisp-interaction-mode" "package-refresh-contents" "package-install" "ibuffer" "org-publish" "mc/edit-lines" "eaf-open-browser" "org-roam-dailies-capture-today" "load-theme" "magit-todos-mode" "mc/mark-all-dwim" "mc/mark-all-like-this" "package-list-packages" "company-mode" "my-copy-simple" "org-roam-db-sync" "org-version" "describe-font" "org-ql-search" "org-roam-setup" "forward-paragraph" "pdf-tools-install" "eli/push-to-gitpage" "variable-pitch-mode" "org-roam-bibtex-mode" "toggle-truncate-lines" "emacs-lisp-macroexpand" "flyspell-mode" "org-roam-tag-add" "pdf-tools-uninstall" "org-html-htmlize-generate-css" "wttrin-cancel-display-in-mode-line" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x))
  ivy-read("M-x " ("edebug-defun" "debug" "toggle-debug-on-error" "org-media-note-hydra/body" "list-processes" "customize-group" "ivy-posframe-mode" "helm-bibtex" "emojify-mode" "orb-note-actions" "deft" "orb-insert-link" "org-noter" "package-delete" "+rime-convert-string-at-point" "org-timeline-export-to-html" "lispy-mode" "org-roam-capture" "lisp-interaction-mode" "package-refresh-contents" "package-install" "ibuffer" "org-publish" "mc/edit-lines" "eaf-open-browser" "org-roam-dailies-capture-today" "load-theme" "magit-todos-mode" "mc/mark-all-dwim" "mc/mark-all-like-this" "package-list-packages" "company-mode" "my-copy-simple" "org-roam-db-sync" "org-version" "describe-font" "org-ql-search" "org-roam-setup" "forward-paragraph" "pdf-tools-install" "eli/push-to-gitpage" "variable-pitch-mode" "org-roam-bibtex-mode" "toggle-truncate-lines" "emacs-lisp-macroexpand" "flyspell-mode" "org-roam-tag-add" "pdf-tools-uninstall" "org-html-htmlize-generate-css" "wttrin-cancel-display-in-mode-line" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

org-insert-link video: completion support

Hello,
I just wanted to document a little customization in case someone finds it useful. Using org-media-note (without org-ref). When I was trying to insert a link via M-x org-insert-link I didn't get any completions in the minibuffer.

The function you have to change for it to work is org-link-set-parameters.
I just defined a completion function really quickly copying and slightly modifying org-link-complete-file.
So if you add this to your init file you will get completions working in the minibuffer:

(defun org-link-complete-video (&optional arg)
"Create a video link using completion."
(let ((file (concat (read-file-name "Video: ") "#0:00:0"))
(pwd (file-name-as-directory (expand-file-name ".")))
(pwd1 (file-name-as-directory (abbreviate-file-name
(expand-file-name ".")))))
(cond ((equal arg '(16))
(concat "video:"
(abbreviate-file-name (expand-file-name file))))
((string-match
(concat "^" (regexp-quote pwd1) "\(.+\)") file)
(concat "video:" (match-string 1 file)))
((string-match
(concat "^" (regexp-quote pwd) "\(.+\)")
(expand-file-name file))
(concat "video:"
(match-string 1 (expand-file-name file))))
(t (concat "video:" file)))))

(org-link-set-parameters "video" :complete #'org-link-complete-video)

why we need "formats" field

it looks like my bib file has no formats field for the video entry. (I'm using Zotero and better bibtex to export bib file).

In fact looking at the code, I'm not sure why we need the formats field.
Basically we already have the file from bib file, from it I think we can extract the extension
and use that as format to proceed..

not sure why there is no formats fields exported, I do set format field in Zotero..

t m keys

t m - in doom - is doing this
Org-Media-Note mode enabled
Org-Media-Note mode disabled
H-v activates Visual mode
s gives me ‘get_property’ failed: property unavailable
:(

option to play remote videos through mpv

It would be great if this package would support playing remote videos as well, does it do that currently?

So far I've been able to play remote videos with the following:

  (emms-play-url "https://youtu.be/AALYPv5xSos")

it would be perfect if I could [[video:https://youtu.be/AALYPv5xSos]]

Incorrect dependency metadata

The Package-Requires metadata header requires versions for the dependencies.
Without these, package managers will fail to build org-media-note properly.
See #20 for the fix.

Play video in ancestor heading (by property inheritance)

环境

  • System - MacOS 12.3.1
  • Emacs - emacs-plus@28
  • (emacs-version) - GNU Emacs 28.1.50 (build 2, aarch64-apple-darwin21.4.0, NS appkit-2113.40 Version 12.3.1 (Build 21E258)) of 2022-04-06
  • (org-version) - 9.5.2

需求描述

现状

和 org-ref 配合使用时,当一个 heading 下有 Custom_ID property,org-media-note-mpv-smart-play 可以正确找到视频并自动播放。但如果光标在该 heading 下的子 headings 的时候,则无法自动播放,而是要手动输入视频地址。

期望

在子 headings 下有播放父级 heading 的 Custom_ID 对应的视频的能力。(针对一个视频做个多级笔记应该是个正常需求吧 😂 )

可能的方案

通过 org-mode property 的继承机制实现。 用户可以通过对 org-use-property-inheritance 进行配置,来达到 property 继承的效果。

所以需要在 org-media-note--current-org-ref-key 中,允许 org-entry-get 查找继承下来的 property 。

(defun org-media-note--current-org-ref-key ()
  "Return the org-ref key of current org entry."
  (org-entry-get (point) org-media-note-ref-key-field 'selective))

问题

设想虽然感觉是 ok 的,但在试验的时候,还是遇到了一些问题…… (不太会 elisp ,见谅……)

我通过使用 # -*- org-use-property-inheritance: '("Custom_ID"); -*- 实现了变量的配置,然后在文件内运行如下代码(通过 source block):

org-use-property-inheritance
;; '("Custom_ID")

(equal '("Custom_ID") org-use-property-inheritance)
;; nil 。期待返回为 t 。

(member-ignore-case "Custom_ID" org-use-property-inheritance)
;; nil 。这里的 org-use-property-inheritance 是 nil 。

(org-entry-get (point) "Custom_ID" 'selective)
;; nil 。期待的方式,会利用用户设置的继承。

(org-entry-get (point) "Custom_ID" t)
;; video_key 。不期待的方式,会强制使用继承。

所以不知道为什么 org-use-property-inheritance 传进方法之后,值就不对了……

Home folder video: links

Normal file links in org use the tilde dash prefix ~/, but for org-media-note video: links; the full path is included instead, breaking links across systems with different usernames:
video:/home/nanjigen/Videos/movie.mp4 vs the preferred video:~/Videos/movie.mp4.

Also, at least for me, using insert i to insert a timestamp creates a link with the prefix nil instead of video; which means I need to repair the link by hand - other than these two issues once edited the links work great

void-function org-media-note-setup-org-ref when not requiring org-media-note-org-ref

Hello Yuchen,

I get the error (void-function org-media-note-setup-org-ref) when I enter an org file.
Installed org-media-note by cloning to directory, adding it to load path, and adding the following to my init.el:

(setq org-media-note-use-org-ref t)
(require 'org-media-note)
(add-hook 'org-mode-hook (lambda () (org-media-note-mode)))

If I add (require 'org-media-note-org-ref) it works.
Is it a bug and you can fix it? Otherwise, if it's expected behaviour, I am happy open a pull request and add it to the readme if you like.

Stack trace:

Debugger entered--Lisp error: (void-function org-media-note-setup-org-ref)
  (org-media-note-setup-org-ref)
  (progn (org-media-note-setup-org-ref))
  (if org-media-note-use-org-ref (progn (org-media-note-setup-org-ref)))
  (progn (advice-add 'org-insert-item :before-until #'org-insert-item--media-note-item) (if org-media-note-use-org-ref (progn (org-media-note-setup-org-ref))))
  (if org-media-note-mode (progn (advice-add 'org-insert-item :before-until #'org-insert-item--media-note-item) (if org-media-note-use-org-ref (progn (org-media-note-setup-org-ref)))) (advice-remove 'org-insert-item #'org-insert-item--media-note-item))
  (let ((last-message (current-message))) (progn (set-default 'org-media-note-mode (cond ((eq arg 'toggle) (not (default-value 'org-media-note-mode))) ((and (numberp arg) (< arg 1)) nil) (t t)))) (if (boundp 'global-minor-modes) (progn (setq global-minor-modes (delq 'org-media-note-mode global-minor-modes)) (if (default-value 'org-media-note-mode) (progn (setq global-minor-modes (cons 'org-media-note-mode global-minor-modes)))))) (if org-media-note-mode (progn (advice-add 'org-insert-item :before-until #'org-insert-item--media-note-item) (if org-media-note-use-org-ref (progn (org-media-note-setup-org-ref)))) (advice-remove 'org-insert-item #'org-insert-item--media-note-item)) (run-hooks 'org-media-note-mode-hook (if (default-value 'org-media-note-mode) 'org-media-note-mode-on-hook 'org-media-note-mode-off-hook)) (if (called-interactively-p 'any) (progn (customize-mark-as-set 'org-media-note-mode) (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local "")) (message "Org-Media-Note mode %sabled%s" (if (default-value ...) "en" "dis") local))))))
  org-media-note-mode()
  (lambda nil (org-media-note-mode))()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(t t)

I am using org-media-note git version fa5c2e7

Add time-range timestamp

I'm envisioning extending the timestamps to include an optional time range. For example:
[[video:course.mp4#a<0:01:55>b<0:02:10>][0:01:55-0:02:10]] This is an example of a 15s loop from 1m55s to 2m10s

Maybe we could then cause org-media-note to treat the range as a loop, which is called via cmd as --ab-loop-a=<time>, --ab-loop-b=<time>. Aside from declaring a snippet of video where something is discussed/occurs, there may be uses on the mpv end in terms of extracting or acting upon the loop with lua, as many scripts do. Moving cursor to point in the org buffer could then optionally allow (maybe based on a setq), the automatic looping of that time range.

error when taking a screenshot

hi @yuchen-lea
First of all it must be said that this package is an excellent job !

Configuration

  • GNU Emacs 28.1.50
  • Org mode version 9.5.3
  • Linux (Arch)
  • mpv 0.34.1

Error when taking a screenshot:
‘screenshot-to-file’ failed: error running command

Does not play well with WM

It is ok.
But seems not to play well with WM.
e.g. I use Stumpwm and it does not T toggle on top and other keys do not work as well :(
Probably will not play well with Xmonad and I3WM.
Perhaps you should add a note about not functioning well with WM/TW...

Noting need to download youtube-dl

I was struggling to view online links for mpv, and discovered you actually need youtube-dl to view online links in mpv. I think this may be worth noting for people who are not familiar with mpv.

press enter didn't insert timestamp in new line

tried to do the same as first demo video does, but in my case, after press i which inserts first timestamp, then I typed some text, after that press enter started a new line, but there is no timestamp inserted this time..

I'm using Doom Emacs, with evil-mode enabled by default

Allow the capture and use of milliseconds

I'm finding I need fainer-grained controls in certain kinds of video. Specifically org-media-note doesn't seem to respond to or capture increments in the milliseconds. Some frames are quite different and yet only be 0.1s apart.

Would it be possible to allow for the hydra to display milliseconds and have mpv respond to millisecond increments? Of course, the link format would have to allow for a full timestamp 0:00:00:00/h:mm:ss:ff <- there might have to be legacy code to allow for backward compatibility with the older link style if this were done.

What do you think?

Integration with org-attach

Another small convenience feature idea: When bringing up org-media-note-hydra/body, and pressing o for opening file brings up a lovely fuzzy search buffer, which defaults to looking inside the same folder of the file being visited.

For those of us who use org-attach and its attach directory, accessing org-attach-dir while viewing a header in an org buffer would be very useful as a first place to search for a media file. Perhaps if org-attach-dir returns nil then the search could fallback to the root of the folder as it does now (this may be tricky as in some circumstances and configs, org-attach-dir may attempt to create the DIR, so getting the function to wait for a nil might fail and empty DIR's would get created in its wake).

This might also allow for screenshots to be saved in the location the media was sourced (i.e., the same org-attach DIR)

Thanks for you time and effort on this, its a great project

discussion: Come up with a way to leave the hydra visible, so we don't have to invoke it so often?

I've just been trying this out, and I love it so far!

Taking notes on a video where I insert timestamps on important steps, and take screenshots of the relevant slides looks great! And if I find out my notes are unclear, I can just click the link and watch the relevant section again.

However, I find that I have to press the keybinding for org-media-note-hydra/body A LOT.

My workflow:

  • open previously created link, so the video is open.
  • hit hotkey for the hydra (in my case, C-c v)
  • (usually, speed up video: c)
  • find something interesting to comment on: i
  • escape the hydra by pressing a key that's not in the menu
  • write note
  • hit hotkey for the hydra
  • repeat

It would be great if the hydra could remain open and the hotkeys only work when the buffer is focused, similar to how the ediff tool creates a new frame with hotkeys that only works when the frame has focus?

Or perhaps we could use some kind of org-capture approach? where hitting i triggers a capture buffer, and after filing it goes back to the hydra? This would also allow creating capture templates, so it would create something like:

* [video url timestamp] note title

I'm not sure what the best approach would be, but I just wanted to make some suggestions to prevent us from having to type the same key-combo so often.

What do you think? Thanks again for the awesome package!

Opening Youtube videos stored as a bibkey

Possibly due to me not following the documentation correctly, I am having some difficulty get a Youtube video to play from a videocite link, or by using o l from the org-media hydra when the cursor is on a org-ref cite link:

  [[videocite:videotest#0:01:28]]
cite:videotest

If the bibkey references a local file, the videocite: link works, but not for a youtube video. Neither local nor remote videos are detected when attempting o l over the cite link.

All bib entries are generated with Zotero.

Thanks, the project is serving me greatly

Explain better

Could you explain these steps better?

"Open related media file in org-ref note,play on top,insert current timestamp and subtitle"
with "M-x something"...
The explanation is not clear :(

add non-doom install guide?

For now I got it to install with use-package like this:

  (use-package quelpa-use-package)  ;; to allow installation of github packages
  (use-package pretty-hydra)   ;; first time it whined that this didn't exist, add dependency?
  (use-package org-media-note
    :quelpa (org-media-note :fetcher github :repo "yuchen-lea/org-media-note")
    :hook (org-mode .  org-media-note-mode)
    :bind (("H-v" . org-media-note-hydra/body))  ;; Main entrance
    :config
    (setq org-media-note-screenshot-image-dir "~/notes/imgs/"))

Error: "failed to provide feature ‘org-media-note.el’""

Great package. Looking forward to being able to use it :)
For the time being I am getting this error when starting my Emacs:

Debugger entered--Lisp error: (error "Loading file /path.to/org-media-note-master/org-media-note.el failed to provide feature ‘org-media-note.el’")

My init config:

(add-to-list 'load-path "path.to/org-media-note-master")
(require 'org-media-note.el)
(setq org-media-note-screenshot-image-dir "path.to/imgs/")  ;; Folder to save screenshot
(setq org-media-note-use-refcite-first t)  ;; use videocite link instead of video link if possible

Thanks for the help!

step by step instructions?

Hi- what you've built here looks amazing and potentially perfect for our use case. Thank you for making it available!

However, I'm not experienced with emacs or org-mode so having a really hard time figuring out how to use org-media-note. I've got it installed, along with org-ref as per your recommendation.

I want to play an online video from a url (the video is in google cloud storage). Is this possible? If so, is there anything that could show me what to do- like step by step instructions or something like that?

I'd really welcome some help. Once I figure out, I can volunteer to write it up and submit it as an add on to your Readme.org - I think it would help other noobs like me :)

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.