Search:  

Previous pageTechniques & KB Articles Next page
Embedding a YouTube video 

Embedding a YouTube video

Embedding YouTube videos on sites is a common requirement, yet the code to do so is typically quite complex, involving IFrames and HTML.

Here we outline a technique that hides all this complexity, and lets a user simply enter the YouTube link, with the system taking care of the rest.

For this example we assume there will be a number of YouTube videos to be embedded.

  1. Start by creating a Table component, and give it a text field called 'Link'
  2. Create a Data Entry Form linked to this, and enter some records, each being a typical YouTube link of the form:
    https://youtu.be/xxxxxxxxxx
  3. Create a Query component based on the Table, and add the Link field
  4. In the Format of the Link field, choose Regular Expression, and Import this one:
    YouTube regular expression (download this to your local machine first, then Import it to your Regular Express dialog)
    This will convert the Link format YouTube use into the url they need in an IFrame
  5. Create an IFrame View component, and link it to the Query. Set the 'Source Field' to the Link field, Url as 'Source Field's Content'
    Use the IFrame Behaviour Editor's Style dialog to set the desired IFrame size.

Now you can embed the IFrame view on a page to see the embedded video, which can be played in-place.

This is a minimalist example, but you would normally expect to have further fields. That way you could have a Table acting as a central Video library, and then use multiple embeds on different pages, each with different criteria, to show videos around the site.

 

           
 

DATA

Managing Data

Tables

Referential Integrity 

Data Entry Forms

Queries and Views

Custom Views

 

USERS & SECURITY

Users & Permissions

User Group Manager 

User Registration

Access Codes & Agreements

Personalizing Experience

Managing Profiles

 

SaaS

SaaS Server

SaaS Site Manager

SaaS Client Accounting

SaaS Templates & Clones

SaaS Self Service

Associates System 

 

CMS

User Editable pages

CSS Editor

Editing Pages

Direct URLs

Using Javascript & JQuery

Content Approval & Workflow

 

WEB

Key Concepts

Components

Understanding Embeds

Site Building

Themes System

SEO Optimization

 
           
 
clearString   neatComponents™    © Enstar LLC  1999-2019 All Rights Reserved      Terms of Use      Privacy & Cookies      Contact us...
 
 
 
 

 

Docs HomePrint:   Print this page