emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using xwidget to play youtube videos


From: joakim
Subject: Re: Using xwidget to play youtube videos
Date: Tue, 09 Feb 2016 10:38:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (gnu/linux)

Lars Ingebrigtsen <address@hidden> writes:

> 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...

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.

-- 
Joakim Verona



reply via email to

[Prev in Thread] Current Thread [Next in Thread]