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: Mon, 22 Feb 2016 10:27:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.91 (gnu/linux)

Lars Ingebrigtsen <address@hidden> 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 via email to

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