1

I'm trying to play a video in Jupyter books and I must be missing something.

This works...but it just auto-plays without controls and without the ability to stop it (unless one clicks and then it opens up with controls)...but it's not obvious to the user that this is a possible action:

{figure} ../_images/relativity/train_simultaneous.mp4
---
width: 60%
figclass: margin-caption
alt: My figure text
name: train_simultaneous
---
The very weird problem of the famous magnet and coil demo. Think hard about this.

If such functionality is not yet working (I think I saw that elsewhere), I don't understand why raw HTML would not work:

<video width="500" poster="../_images/relativity/train_cover.png" controls>
<source src="../_images/relativity/train_simultaneous.mp4" type="video/mp4">
</video>
</center>

That just sits there with a video start button. Clicking on it gives a frame, but for a zero second long video, so it's not loaded at all. I know this is a perfectly fine video source html as if I upload it to a server:

<video width="600"  controls>
  <source src="https://qstbb.pa.msu.edu/storage/QSBB_videos/relativity_temp/train_simultaneous.mp4" type="video/mp4">
</video>
</center>

...it works fine. The only difference is a local file versus a hosted file.

Ideas? I thought raw HTML would always be respected? (It is in bookdown and RStudio, which is what I'm converting from.) I've tried this with multiple acceptable video clips. All mp4.

  • Perhaps something in the page or your browser prevents proper loading of the video? Try Incognito or a private browser session. – Steve Piercy Jun 28 '21 at 06:18
  • Thanks. That doesn't appear to be the case. Good idea, though. This is migrating working book files from RStudio and bookdown to Jupyterbooks. So really the only difference seems to be local versus hosted video. – Raymond Brock Jun 29 '21 at 20:21
  • Does the file get copied from your reST source directory to its build directory when you build docs? Is the path in your HTML to the file correct? Maybe remove the leading `../`? – Steve Piercy Jun 30 '21 at 05:27

0 Answers0