all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: joakim@verona.se
To: emacs-devel@gnu.org
Subject: Re: Using xwidget to play youtube videos
Date: Mon, 22 Feb 2016 10:27:48 +0100	[thread overview]
Message-ID: <m3y4adt7qj.fsf@exodia.verona.se> (raw)
In-Reply-To: <874md1z9d1.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 22 Feb 2016 14:56:10 +1100")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've taken another short stab at playing with xwidget, and I can't
> really make heads or tails of it, I'm afraid.  Patch to eww below.
>
> First of all, it seems like all the xwidget functions are geared towards
> only being displayed in an xwidget buffer.  The xwidget functions rename
> buffers willy-nilly when just inserting an xwidget into a buffer, and
> that should not happen.  There are also hard-coded callbacks in the
> xwidgets for adjusting the size and ... stuff ... that don't make any
> sense in anything but xwidget buffers, either.

There are a lot of functions that are gearead toward managing a xwidget
instance in a buffer which behaves like image mode. They only work in
that particular use case. Those functions could have their own prefix I
suppose. Also I was probably sloppy in some cases and wrote functions
that assumed a webkit browser buffer rather than taking a xwidget
instance as an argument.

Anyway, I would like to improve the api so it works better in this
use-case, and I think that mostly involves, doing what you say below.

>
> The xwidget core code has to be separated out from the xwidget mode
> code, and the latter should set the callbacks it wants to use.
>
> I think that's probably easily doable, but it would be nice if someone
> who knew the code and what it was trying to do did that.  :-)
>
> Second of all, it's quite glitchy.  Even if you manage to somehow insert
> an xwidget into your buffer, scrolling around in the buffer sometimes
> makes the xwidget show up twice, or no times, or leaves half the widget
> displayed and half not.


Needless to say I don't experience the glitchiness you seem to
experience, on my Fedora 23 install(And previouse fedora releases). It
would be useful to know which library versions you have, and if they are
older than the one Fedora ships, we could hinder compilation with those
library versions.

I can also have missed some cases of clipping, which might show up in
your setup but not in mine. The widget showing up twice might be due to
a clipping problem. "half, or no times" do you mean that the entire
xwidget is on screen, but doesnt show properly?

>
> So, er...  this stuff doesn't really seem finished.  :-)  I think it's
> exciting, but it needs work.  Should this be in emacs-25?
>
> diff --git a/lisp/net/eww.el b/lisp/net/eww.el
> index 7f9f4fa..3d94508 100644
> --- a/lisp/net/eww.el
> +++ b/lisp/net/eww.el
> @@ -426,6 +426,7 @@ eww-display-html
>                '((title . eww-tag-title)
>                  (form . eww-tag-form)
>                  (input . eww-tag-input)
> +                (iframe . eww-tag-iframe)
>                  (button . eww-form-submit)
>                  (textarea . eww-tag-textarea)
>                  (select . eww-tag-select)
> @@ -2000,6 +2001,16 @@ eww-restore-desktop
>  (add-to-list 'desktop-buffer-mode-handlers
>               '(eww-mode . eww-restore-desktop))
>  
> +(defun eww-tag-iframe (dom)
> +  (when (fboundp 'make-xwidget)
> +    (require 'xwidget)
> +    (insert "-")
> +    (let ((xw (xwidget-insert (1- (point)) '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))
> +      (insert "---"))))
> +
>  ;;; Isearch support
>  
>  (defun eww-isearch-next-buffer (&optional _buffer wrap)

-- 
Joakim Verona



  reply	other threads:[~2016-02-22  9:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3y4adt7qj.fsf@exodia.verona.se \
    --to=joakim@verona.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.