Jump to main content
University Computer Centre
Embedding videos
University Computer Centre 

Embedding videos

Videocampus Sachsen

The Videocampus Sachsen is a powerful platform, that delivers videos in different formats, with subtitles, and with textual description (Accessibility). Please prefer to use it!

Basics for own embedding

With HTML5, videos can be easily embedded into a web page. The video must be in H.264 encoding (H.264 video codec + AAC audio codec) with .mp4 file extension to be playable in all current web browsers. The following free formats are unfortunately not played by all web browsers, but can still be specified for older browsers:

  • VP8 or VP9 video codec + Vorbis audio codec – file extension .webm
  • Theora video codec + Vorbis audio codec – file extension .ogg

How to embed the video:

<video controls poster="/tu/film/film.jpg">
  <source src="/tu/film/tu-chemnitz_german.mp4" type="video/mp4">
  <source src="/tu/film/tu-chemnitz_german.webm" type="video/webm">
  Your browser does not support playing this video.
  <a href="/tu/film/tu-chemnitz_german.mp4">Download MP4 Video</a>
</video>

This is what it looks like:

Further hints

  • If you want the video to start playing immediately after loading the web page, add autoplay to the video tag.
  • If you want to start or pause playback by clicking on the video, you need to add some JavaScript - in a separate video.js file:
    $(document).ready(function() {
      // Für video mit id="video2" Klick-Aktionen
      $('#video2').click(function(){
        if (typeof InstallTrigger == 'undefined') 
          this.paused this.play() : this.pause();
      });
    });
    To include this, the page header must say:
    <?php
    require_once('config.inc');
    $javascript[] = 'video.js';
    seite(__FILE__); ?>

See also: