Skip to content

I want to display YouTube videos on the editing screen

Answer

Display the prepared YouTube embed tag in "Script".


Overview

This explains how to display and play videos using YouTube embed tags on the editing screen.

Preparations

(1) Open the target table and open "Manage Table" from the "Manage" menu.
(2). Add ClassA in the Editor tab. Change the name to "Embed Tag" or similar.
(3). Open the Script tab, click the "New" button, enter any title in "Title", and enter the following script in "Script".

JavaScript

// Set the iframe for the video
showMovie = function () {
    // Get the embed tag entered in ClassA
    var html = $p.getControl('ClassA').val();
    // Set the embed tag in the content field
    $p.getControl('Body').parent().html(html);
}
// Show the video when the page is displayed
   showMovie(); 
// Change the video when ClassA is changed
$p.on('change', 'ClassA', function () {
   showMovie(); 
});

(4) Set "Output to" to "Edit" only.
(5) Click the "Change" button to close the dialog.
(6) Click the "Update" button at the bottom of the screen.
(7) Open any record and enter the YouTube embed tag in the "Embed tag" field.

Please refer to the help procedure below on how to obtain the tags for YouTube embedding.
https://support.google.com/youtube/answer/171780?hl=en