Videojs - unique video id

GET ID

Nuevo plugin features an option to set unique id for video. This is also the case of multiple videos included into nuevo playlist.
Unique video id is required when using nuevo resume option. Video id is also useful to identify video for media tracking events.
A unique video id is possible to set in several ways:

  1. As video source tag parameter:
    Code snippet
    <video id="my_player" class="video-js vjs-fluid" preload playsiniline>
    <source src="//path-to-video-playlist.m3u8" type="application/x-mpegURL" video_id="your-unique-id">
    </video>
    
  2. When setting up video source through javascript:
    Code snippet
    player.src({ src:"//path-to-video-playlist.m3u8" type:"application/x-mpegURL" video_id:"your-unique-id"});
    
  3. As nuevo plugin option:
    Code snippet
    player.nuevo({ video_id: "your-unique-id", title: "video title"  });
    
  4. To get current video_id use simple function:
    Code snippet
    var video_id = player.video_id();