SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    calif
    Posts
    733
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with set up instructions of video.js

    I got limited help trying to set up this player:
    http://www.videojs.com/docs/setup/

    The link instructions are pretty short/(easy for someone more skilled than me), but I need some advice, please. The self-hosted instructions show this:


    Code:
     <link href="http://example.com/path/to/video-js.css" rel="stylesheet">
        <script src="http://example.com/path/to/video.js"></script>
        <script>
          _V_.options.flash.swf = "http://example.com/path/to/video-js.swf"
        </script>
    The help I got added this code to appropriate file:

    Code:
    <link href="http://theurl.com/video-js/video-js.css" rel="stylesheet">
    <script src="http://theurl.com/video-js/video-js.css"></script>
    <script>
          _V_.options.flash.swf = "http://theurl.com/video-js/video-js.swf"
    </script>
    
     <video id="mp4" class="video-js vjs-default-skin"
          controls preload="auto" width="640" height="264"
          poster="http://video-js.zencoder.com/oceans-clip.png"
          data-setup='{"example_option":true}'>
          <source src="http://theurl.com/uploads/" type='video/mp4' />
    </video>

    According to the very short instructions at http://www.videojs.com/docs/setup/
    does this new added code look right?

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,889
    Mentioned
    208 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    There is one mistake in the first part of the code.

    This:

    HTML Code:
    <script src="http://theurl.com/video-js/video-js.css"></script>
    should be:

    HTML Code:
    <script src="http://theurl.com/video-js/video.js"></script>
    The general format is:

    HTML Code:
    <head>
      <title>Video.js | HTML5 Video Player</title>
    
      <!-- Change URL to wherever Video.js files will be hosted -->
      <link href="video-js.css" rel="stylesheet" type="text/css">
    
      <!-- video.js must be in the <head> for older IEs to work. -->
      <script src="video.js"></script>
    
      <!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
      <script>
        _V_.options.flash.swf = "video-js.swf";
      </script>
    </head>
    In the second part, you need to specify a video file to link to.
    You might also want to consider including a webm version and/or an ogv version of your file, depending on which browsers you want to support.

    Like this:

    HTML Code:
    <video id="mp4" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264" poster="http://video-js.zencoder.com/oceans-clip.png" data-setup='{"example_option":true}'>
      <source src="http://theurl.com/uploads/film.mp4" type='video/mp4' />
      <source src="http://theurl.com/uploads/film.webm" type='video/webm' />
      <source src="http://theurl.com/uploads/film.ogv" type='video/ogg' />
    </video>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •