unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Using xwidget to play youtube videos
@ 2016-02-09  5:58 Lars Ingebrigtsen
  2016-02-09  9:38 ` joakim
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-09  5:58 UTC (permalink / raw)
  To: emacs-devel; +Cc: joakim

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




^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2016-02-23  1:24 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-09  5:58 Using xwidget to play youtube videos Lars Ingebrigtsen
2016-02-09  9:38 ` joakim
2016-02-09 22:55   ` Lars Ingebrigtsen
2016-02-10 14:14     ` Richard Stallman
2016-02-10 14:41       ` Andreas Schwab
2016-02-11  5:18         ` Marcin Borkowski
2016-02-11  9:51           ` Andreas Schwab
2016-02-11 18:21           ` Richard Stallman
2016-02-21 17:17             ` Nix
2016-02-22  3:56               ` Lars Ingebrigtsen
2016-02-22  9:27                 ` joakim
2016-02-22 16:26                   ` Eli Zaretskii
2016-02-23  1:24                   ` Lars Ingebrigtsen
2016-02-22 16:09                 ` Eli Zaretskii
2016-02-22 18:59                   ` joakim
2016-02-22 18:59                   ` John Wiegley
2016-02-12  3:43           ` Matthew Carter
2016-02-12 13:05             ` Marcin Borkowski
2016-02-13 15:33               ` Richard Stallman
2016-02-14 12:21                 ` Elias Mårtenson
2016-02-14 12:33                   ` Dmitry Gutov
2016-02-14 15:32                     ` Elias Mårtenson
2016-02-15 10:26                   ` Richard Stallman
2016-02-15 10:42                     ` Marcin Borkowski
2016-02-11  3:48       ` Lars Ingebrigtsen
2016-02-11 18:21         ` Richard Stallman
2016-02-11 18:46           ` joakim
2016-02-12 12:34             ` Richard Stallman
2016-02-09 16:31 ` raman
2016-02-09 22:59   ` Lars Ingebrigtsen
2016-02-10  8:03     ` joakim
2016-02-09 16:51 ` Eli Zaretskii
2016-02-09 23:00   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).