video.html 5.06 KB
Newer Older
1 2
<%! from django.utils.translation import ugettext as _ %>

3
% if display_name is not UNDEFINED and display_name is not None:
4
    <h2>${display_name}</h2>
Piotr Mitros committed
5
% endif
6

7 8
<div
    id="video_${id}"
9
    class="video closed"
10

11
    data-streams="${youtube_streams}"
12 13 14 15

    ${'data-sub="{}"'.format(sub) if sub else ''}
    ${'data-autoplay="{}"'.format(autoplay) if autoplay else ''}

16 17 18
    ${'data-mp4-source="{}"'.format(sources.get('mp4')) if sources.get('mp4') else ''}
    ${'data-webm-source="{}"'.format(sources.get('webm')) if sources.get('webm') else ''}
    ${'data-ogg-source="{}"'.format(sources.get('ogv')) if sources.get('ogv') else ''}
19

20
    data-save-state-url="${ajax_url}"
21 22
    data-caption-data-dir="${data_dir}"
    data-show-captions="${show_captions}"
23
    data-general-speed="${general_speed}"
24
    data-speed="${speed}"
25 26 27 28
    data-start="${start}"
    data-end="${end}"
    data-caption-asset-path="${caption_asset_path}"
    data-autoplay="${autoplay}"
Anton Stupak committed
29 30
    data-yt-test-timeout="${yt_test_timeout}"
    data-yt-test-url="${yt_test_url}"
31

32 33 34 35 36 37 38 39 40 41 42 43 44
    ## For now, the option "data-autohide-html5" is hard coded. This option
    ## either enables or disables autohiding of controls and captions on mouse
    ## inactivity. If set to true, controls and captions will autohide for
    ## HTML5 sources (non-YouTube) after a period of mouse inactivity over the
    ## whole video. When the mouse moves (or a key is pressed while any part of
    ## the video player is focused), the captions and controls will be shown
    ## once again.
    ##
    ## There is no option in the "Advanced Editor" to set this option. However,
    ## this option will have an effect if changed to "True". The code on
    ## front-end exists.
    data-autohide-html5="False"

45
    tabindex="-1"
46
>
Valera Rozuvan committed
47 48
    <div class="focus_grabber first"></div>

49
    <div class="tc-wrapper">
50
      <a href="#before-transcript_${id}" class="nav-skip sr">${_("Skip to a navigable version of this video's transcript.")}</a>
51

52
      <article class="video-wrapper">
53
          <span tabindex="0" class="spinner" aria-hidden="false" aria-label="${_('Loading video player')}"></span>
54
          <span tabindex="-1" class="btn-play is-hidden" aria-hidden="true" aria-label="${_('Play video')}"></span>
55 56 57 58 59 60
          <div class="video-player-pre"></div>
          <section class="video-player">
              <div id="${id}"></div>
              <h3 class="hidden">${_('ERROR: No playable video sources found!')}</h3>
          </section>
          <div class="video-player-post"></div>
61
          <section class="video-controls is-hidden">
polesye committed
62
              <div class="slider" title="${_('Video position')}"></div>
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
              <div>
                  <ul class="vcr">
                      <li><a class="video_control" href="#" title="${_('Play')}" role="button" aria-disabled="false"></a></li>
                      <li><div class="vidtime">0:00 / 0:00</div></li>
                  </ul>
                  <div class="secondary-controls">
                      <div class="speeds">
                          <a href="#" title="${_('Speeds')}" role="button" aria-disabled="false">
                              <h3>${_('Speed')}</h3>
                              <p class="active"></p>
                          </a>
                          <ol class="video_speeds"></ol>
                      </div>
                      <div class="volume">
                          <a href="#" title="${_('Volume')}" role="button" aria-disabled="false"></a>
                          <div class="volume-slider-container">
                              <div class="volume-slider"></div>
                          </div>
                      </div>
                      <a href="#" class="add-fullscreen" title="${_('Fill browser')}" role="button" aria-disabled="false">${_('Fill browser')}</a>
                      <a href="#" class="quality_control" title="${_('HD off')}" role="button" aria-disabled="false">${_('HD off')}</a>

                      <a href="#" class="hide-subtitles" title="${_('Turn off captions')}" role="button" aria-disabled="false">${_('Turn off captions')}</a>
                  </div>
              </div>
          </section>
89
          <a class="nav-skip sr" id="before-transcript_${id}" href="#after-transcript_${id}">${_('Skip to end of transcript.')}</a>
90
      </article>
91

92 93 94
      <ol id="transcript-captions" class="subtitles" tabindex="0" title="${_('Captions')}" role="group" aria-label="${_('Activating an item in this group will spool the video to the corresponding time point. To skip transcript, go to previous item.')}">
        <li></li>
      </ol>
95
    </div>
96

97
    <a class="nav-skip sr" id="after-transcript_${id}" href="#before-transcript_${id}">${_('Go back to start of transcript.')}</a>
98

Valera Rozuvan committed
99
    <div class="focus_grabber last"></div>
100 101 102 103 104 105 106 107 108 109 110 111
  <ul class="wrapper-downloads">
    % if sources.get('main'):
        <li class="video-sources">
            ${('<a href="%s">' + _('Download video') + '</a>') % sources.get('main')}
        </li>
    % endif
    % if track:
        <li class="video-tracks">
            ${('<a href="%s">' + _('Download timed transcript') + '</a>') % track}
        </li>
    % endif
  </ul>
112
</div>