How to display a video in a portal campaign without having to use youtube link?

ServiceNowCons
Tera Contributor

Display a video in campaign content without having a link to youtube but instead use a video from the db_videos table?

I want to have a video as content for a campaign but by choosing video as the content style I must add a URL to Youtube or Vimeo. Is there anyway I can use the db_videos table instead of having to link to an external source? Is Rich text an option?


6 REPLIES 6

Community Alums
Not applicable

Hi @ServiceNowCons ,

 Nope that's not possible.

 

Amit Gujarathi
Giga Sage
Giga Sage

Hi @ServiceNowCons ,
I trust you are doing fine.
Here's an example code snippet that you can use to display a video from the db_videos table in a campaign:

 

<!-- Assuming that you have a video record in the db_videos table with sys_id='1234567890' -->
<video controls>
  <source src="/sys_attachment.do?sys_id={{db_video.sys_id}}" type="{{db_video.file_type}}"/>
</video>

 

In the above code, we're using the sys_attachment.do URL to get the video file from the db_videos table based on its sys_id. We're also specifying the file type of the video in the type attribute of the source tag.

You can add this code to the campaign content using the Rich Text editor in ServiceNow. Simply switch to the HTML view of the editor and paste the code there. Make sure to replace {{db_video.sys_id}} and {{db_video.file_type}} with the appropriate values for your video record.


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi