diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-09 07:10:18 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-09 07:47:17 +0100 |
commit | 430d12e3c0d83603596e5d61541973c731e4f983 (patch) | |
tree | 3020c70d63c03e135360bba633b7da1ecf8385f0 /lisp/net/shr.el | |
parent | ba0e4f3ad3f0605a99b497e2a375a1e1cfacb35c (diff) | |
download | emacs-430d12e3c0d83603596e5d61541973c731e4f983.tar.gz emacs-430d12e3c0d83603596e5d61541973c731e4f983.tar.bz2 emacs-430d12e3c0d83603596e5d61541973c731e4f983.zip |
Don't create temporary files for <video>
* lisp/net/shr.el (shr-tag-audio): Don't create a temporary file;
just update the DOM directly.
Diffstat (limited to 'lisp/net/shr.el')
-rw-r--r-- | lisp/net/shr.el | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index d5d6d63fdde..19d2d8a8e6b 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1685,23 +1685,16 @@ The preference is a float determined from `shr-prefer-media-type'." 'webkit "Video" (truncate (* (window-pixel-width) 0.8)) - (truncate (* (window-pixel-width) 0.8 0.75)))) - (file (make-temp-file "shr" nil ".html"))) - (run-at-time 1 nil (lambda () - (ignore-errors - (delete-file file)))) + (truncate (* (window-pixel-width) 0.8 0.75))))) (insert (propertize " [video] " 'display (list 'xwidget :xwidget widget))) - (with-temp-buffer - (insert - (format - "<video autoplay loop muted><source src=%S type=\"video/mp4\"></source></video>" - url)) - (write-region (point-min) (point-max) file nil 'silent)) - (xwidget-webkit-goto-uri widget - (concat "file://" file)))) + (xwidget-webkit-execute-script + widget (format "document.body.innerHTML = %S;" + (format + "<video autoplay loop muted><source src=%S type='video/mp4\'></source></video>" + url))))) ;; No xwidgets. (if (> (length image) 0) (shr-indirect-call 'img nil image) |