Instead of embedding videos inline, this page displays the image and duration of the video using Cards Media Advanced Formatting. This page uses two different REST Data Sources based on the YouTube Data API to display the Oracle APEX videos in that playlist.
- Playlistitems: Gets videos for a given playlist
- Video: Gets video duration for each video
- The
eba_demo_card_pkg.get_video_duration
function calls a Video REST Data Source using the APEX_EXEC API to get the duration for each video
- Playlistitems REST Data source has an extra data profile column that is derived from a SQL Expression calling the function above
- All these REST Data Sources are cached for 7 days, so there are no extra requests made until the cache expires
- To display the video duration, the Media HTML Expression uses an inline CSS class,
.a-CardView-videoLength
, which is defined on the page (in the CSS section's Inline attribute)
- A Full Card Action is defined to watch the video on YouTube when a card is clicked