acl-anthology icon indicating copy to clipboard operation
acl-anthology copied to clipboard

Embed videos on paper page

Open mjpost opened this issue 5 years ago • 1 comments

It would be nice to embed videos on the paper pages. This shouldn't be hard to implement. It would require:

  1. Modifying the paper page template, hugo/layouts/papers/single.html, to embed the video
  2. Maybe writing a custom field in the generated YAML that is used by Hugo to build the Anthology. This would be done by creating a field, say video_embed_link, in the from_xml() function in bin/anthology/papers.py. (This file is used to load papers from the XML file, and all of its attrib attributes are dumped to the YAML).

We link to videos on Vimeo and Slideslives, which likely have different embedding code blocks, which is the reason for point 2 above.

mjpost avatar Sep 12 '20 17:09 mjpost

Here is the code to embed Slideslive (where XXX should be replaced by the Slideslive ID, e.g., 38928822):

    <div class="col-md-12 col-xs-12 my-auto p-2" >
      <div id="presentation-embed" class="slp my-auto"></div>
      <script src='https://slideslive.com/embed_presentation.js'></script>
      <script>
        embed = new SlidesLiveEmbed('presentation-embed', {
        presentationId: 'XXX',
        autoPlay: false, // change to true to autoplay the embedded presentation
        verticalEnabled: true,
        verticalWhenWidthLte: 500,
        allowHiddenControlsWhenPaused: true,
        hideTitle: true
        });
      </script>

      <div class="text-muted">
      NOTE: The SlidesLive video may display a random order of the authors.
      The correct author list is shown at the top of this webpage.
      </div>
    </div>

mjpost avatar Sep 13 '20 01:09 mjpost