[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using xwidget to play youtube videos
From: |
Lars Ingebrigtsen |
Subject: |
Using xwidget to play youtube videos |
Date: |
Tue, 09 Feb 2016 16:58:51 +1100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
To start playing around with xwidget in eww, I looked at what xwidget
was doing, and I basically ended up with:
(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)))))
And it works! Youtube is playing away. But I get the follwoing:
Debugger entered--Lisp error: (wrong-type-argument xwidgetp nil)
xwidget-resize(nil 976 674)
xwidget-webkit-adjust-size-to-window()
xwidget-webkit-adjust-size-dispatch()
xwidget-webkit-callback(#<xwidget > document-load-finished)
xwidget-event-handler()
funcall-interactively(xwidget-event-handler)
call-interactively(xwidget-event-handler nil nil)
command-execute(xwidget-event-handler)
Since I haven't requested any resizing of my widget, that's a bit
surprising.
(defun xwidget-webkit-adjust-size-to-window ()
"Adjust webkit to window."
(interactive)
(xwidget-resize (xwidget-webkit-current-session) (window-pixel-width)
(window-pixel-height)))
So... (xwidget-webkit-current-session) is nil? I tried grepping
through the xwidget documentation for "session" but didn't see anything
obvious...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Using xwidget to play youtube videos,
Lars Ingebrigtsen <=
- Re: Using xwidget to play youtube videos, joakim, 2016/02/09
- Re: Using xwidget to play youtube videos, Lars Ingebrigtsen, 2016/02/09
- 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