From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: Using xwidget to play youtube videos Date: Tue, 09 Feb 2016 10:38:06 +0100 Message-ID: References: <87y4auctlw.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455010745 953 80.91.229.3 (9 Feb 2016 09:39:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2016 09:39:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 09 10:38:54 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aT4l3-0002Bl-0U for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 10:38:53 +0100 Original-Received: from localhost ([::1]:53607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT4l2-0002eG-0Z for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 04:38:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT4km-0002e3-5P for emacs-devel@gnu.org; Tue, 09 Feb 2016 04:38:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT4ki-000649-Ay for emacs-devel@gnu.org; Tue, 09 Feb 2016 04:38:36 -0500 Original-Received: from mx2.bahnhof.se ([213.80.101.12]:50780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT4ki-000643-47 for emacs-devel@gnu.org; Tue, 09 Feb 2016 04:38:32 -0500 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx2-reinject (Postfix) with ESMTP id EDBEE4352D; Tue, 9 Feb 2016 10:38:29 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF4) Original-Received: from mf4.bahnhof.se ([127.0.0.1]) by localhost (mf4.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ker8LiZ9bC81; Tue, 9 Feb 2016 10:38:24 +0100 (CET) Original-Received: from mta.verona.se (h-235-62.a149.priv.bahnhof.se [85.24.235.62]) by mf4.bahnhof.se (Postfix) with ESMTP id 482763D78AE; Tue, 9 Feb 2016 10:38:21 +0100 (CET) Original-Received: from localhost (unknown [127.0.0.1]) by mta.verona.se (Postfix) with ESMTP id CA1894E249B; Tue, 9 Feb 2016 09:38:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at verona.se Original-Received: from mta.verona.se ([127.0.0.1]) by localhost (exodia.verona.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Embeu3MUnsUd; Tue, 9 Feb 2016 10:38:06 +0100 (CET) Original-Received: from exodia.verona.se (www.verona.se [192.168.200.15]) by mta.verona.se (Postfix) with ESMTP id 6A2C54E2471; Tue, 9 Feb 2016 10:38:06 +0100 (CET) In-Reply-To: <87y4auctlw.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 09 Feb 2016 16:58:51 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 213.80.101.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199586 Archived-At: Lars Ingebrigtsen 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(# 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