#7298: use html5 video tag for animations
-------------------------------------+-------------------------------------
       Reporter:  whuss              |        Owner:  whuss
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  graphics           |   Resolution:  fixed
       Keywords:  animation, video   |    Merged in:
        Authors:  Martin von Gagern  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/gagern/ticket/7298               |  00e1b487938287b694fa190645c1323c5a5be278
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by gagern):

 Replying to [comment:71 vbraun]:
 > Thanks, looks much better.

 Glad you say so. I'm still a bit concerned by the fact that a format
 supported by backend and FFmpeg still won't be supported only because it's
 not in our list.

 I'm slightly worried by the fact that we save the video to some temporary
 file, only to copy it to the current working directory in a subsequent
 step, where SageNB can pick it up. This feels kind of wasteful. As far as
 I see, the temporary file used for the rich output never gets deleted (if
 this is wrong, where is the code doing that), which means a long-running
 SageNB process will accumulate temporary files without association to
 notebook cells, and might exhaust some tempfs due to this. Should this be
 a separate ticket?

 > I still dislike that HTML 5 tag attributes are attached to the rich
 output types, that makes no sense outside of a browser.

 Well, most of the attributes map to other players as well. To support that
 claim, take e.g. `xine` which has `-Z` to suppress autoplay, `--hide-gui`
 and `--no-gui` to disable controls, and `--loop` or perhaps
 `--loop=repeat` to loop. So while the names of the attributes were taken
 from HTML5, the semantics can be found elsewhere as well.

 The main problem is that each viewer has a different set of command line
 arguments to represent these options, and as long as we open stuff through
 `xdg-open` (which I consider the most likely approach for
 `BackendIPythonCommandline` on Linux), we have little chance of actually
 supporting any of this outside the browser in the near future.

 > The settings in question:
 > * autoplay: Pointless, you ran `animation.show()` so obviously you want
 to see the animation

 Use case: Creating the animation takes five minutes, so you work in some
 other window while Sage gets its act together. When you switch back you
 want to be able to view the animation from the beginning using a single
 click. Or perhaps you have a loop creating several animations, and want to
 show them one after the other. Controlling when an animation starts may be
 particularly important in an environment where you have an audience, and
 some effect visible in the animation which you don't want to divulge
 prematurely.

 > * controls: Who would ever want no video controls? Hard to imagine any
 use case for that on a scientific data visualization platform.

 I guess you are right there. I guess the main reason to have that in HTML
 is when you have your own controls written in !JavaScript. Not something
 we need to worry about.

 > * loop: Seems desirable

 Mapping `loop` to e.g. the IPython command line backend sounds like it's
 going to be really tricky, but I think we simply have to live with the
 fact that some backends won't support some of the features.

 > So IMHO we should only have a `loop=True` optional keyword argument on
 the video output types, and no attrs={} dictionary.

 If I could convince you with the `autoplay` use cases, should I add two
 keyword arguments? I guess so.

--
Ticket URL: <http://trac.sagemath.org/ticket/7298#comment:72>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to