From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Using xwidget to play youtube videos Date: Tue, 09 Feb 2016 16:58:51 +1100 Message-ID: <87y4auctlw.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454997589 1688 80.91.229.3 (9 Feb 2016 05:59:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2016 05:59:49 +0000 (UTC) Cc: joakim@verona.se To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 09 06:59:39 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 1aT1Ks-0002gQ-Be for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 06:59:38 +0100 Original-Received: from localhost ([::1]:52185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT1Kr-0002x1-JN for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 00:59:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT1Kn-0002wm-U2 for emacs-devel@gnu.org; Tue, 09 Feb 2016 00:59:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT1Ki-0006UL-Oo for emacs-devel@gnu.org; Tue, 09 Feb 2016 00:59:33 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:54953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT1Ki-0006Tt-IA for emacs-devel@gnu.org; Tue, 09 Feb 2016 00:59:28 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aT1KC-0000SC-Qy; Tue, 09 Feb 2016 06:58:57 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aT1KC-0000SC-Qy MailScanner-NULL-Check: 1455602337.74569@lYHEOZ7Qi9M1CVUuiR2oNQ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:199575 Archived-At: 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... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no