Building a Video Widget in ServiceNow Service Portal

Author: Rohan Aditya

Date: 23rd December 2025

Key points covered:

  • Background video banner
  • Search widget overlay
  • Instance options

Quick Navigation

Widget HTML


<div class="he-hero-section">
  <video
    class="he-hero-video"
    autoplay
    muted
    loop
    playsinline>
    <source src="f1-banner.mp4" type="video/mp4">
  </video>

  <div class="he-hero-content" ng-show="data.show_search_box">
  <h1 class="he-hero-title"> {{data.title}} </h1>
    <sp-widget widget="data.typeAheadSearch"></sp-widget>
  </div>
</div>
    

Server Script


var aisEnabled = $sp.isAISearchEnabled();

options = options || {};

if (aisEnabled) {
  options.utterancePlacement = 'body';
  options.placement = 'dynamic-landing';

  data.typeAheadSearch =
    $sp.getWidget('typeahead-search', options);
} else {
  data.typeAheadSearch =
    $sp.getWidget(
      'typeahead-search',
      options.typeahead_search || options
    );
}

data.title = options.title;
data.show_search_box = options.show_search_box;
          

Instance Options Schema


[
  {
    "name": "show_search_box",
    "section": "Presentation",
    "label": "Show Search Box",
    "type": "boolean",
    "default_value": "true"
  }
]

          

The complete widget logic is already documented above, including the server script, client controller, instance options, and HTML structure. If you would like to download the full Widget XML file, use the button below.

Final Output

This is how the video widget looks in the Portal: