[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using xwidget to play youtube videos
From: |
Lars Ingebrigtsen |
Subject: |
Re: Using xwidget to play youtube videos |
Date: |
Wed, 10 Feb 2016 09:55:08 +1100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
address@hidden writes:
> Can I test this somehow? Do I just defun eww-tag-iframe and view a
> youtube video url?
>
> There is some code to resize xwidgets, but it shouldn't trigger in your
> case I think.
You need the following patch, and view a page that inlines Youtube
videos.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index fdac464..aef6fde 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -425,6 +425,7 @@ eww-display-html
shr-external-rendering-functions
'((title . eww-tag-title)
(form . eww-tag-form)
+ (iframe . eww-tag-iframe)
(input . eww-tag-input)
(button . eww-form-submit)
(textarea . eww-tag-textarea)
@@ -2013,6 +2014,14 @@ eww-isearch-next-buffer
(eww-previous-url)))
(current-buffer))
+(defun eww-tag-iframe (dom)
+ (when (fboundp 'make-xwidget)
+ (require 'xwidget)
+ (let ((xw (xwidget-insert 1 'webkit-osr (current-buffer)
+ (string-to-number (dom-attr dom 'width))
+ (string-to-number (dom-attr dom 'height)))))
+ (xwidget-webkit-goto-uri xw (dom-attr dom 'src)))))
+
(provide 'eww)
;;; eww.el ends here
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Using xwidget to play youtube videos, Lars Ingebrigtsen, 2016/02/09
- Re: Using xwidget to play youtube videos, joakim, 2016/02/09
- Re: Using xwidget to play youtube videos,
Lars Ingebrigtsen <=
- Re: Using xwidget to play youtube videos, Richard Stallman, 2016/02/10
- Re: Using xwidget to play youtube videos, Andreas Schwab, 2016/02/10
- Re: Using xwidget to play youtube videos, Marcin Borkowski, 2016/02/11
- Re: Using xwidget to play youtube videos, Andreas Schwab, 2016/02/11
- Re: Using xwidget to play youtube videos, Richard Stallman, 2016/02/11
- Re: Using xwidget to play youtube videos, Nix, 2016/02/21
- Re: Using xwidget to play youtube videos, Lars Ingebrigtsen, 2016/02/21
- Re: Using xwidget to play youtube videos, joakim, 2016/02/22
- Re: Using xwidget to play youtube videos, Eli Zaretskii, 2016/02/22
- Re: Using xwidget to play youtube videos, Lars Ingebrigtsen, 2016/02/22