Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.






                // get the source of the iframe
var source = window.parent.location.href;
console.log("the source is " + source);

if (source.includes('vydata%5B')) {
// this means the player is embedded on a page
  console.log("player is embedded");
  var label = "%5Burl_params";
  var i =;
  var parameters = source.substring(i).split("&")[0].split("=")[1].split("%26");
  console.log("parameters is " + parameters);
  var split_var = "%3D"

else  {
  // this means the player is on the sharing page
  console.log("player is on a sharing page");
  var source_queries = source.split("?")[1];
  console.log("source queries is " + source_queries);
  var parameters = source_queries.split("&");
  console.log("source list is " + parameters);
  var split_var = "="

for (parameter in parameters) {
  if (parameters[parameter].includes("utm_campaign")) {
      var utm_campaign = parameters[parameter].split(split_var)[1];
      console.log("utm_campaign from event is " + utm_campaign);

  } else if (parameters[parameter].includes("utm_source")) {
      var utm_source = parameters[parameter].split(split_var)[1];
      console.log("utm_source from event is " + utm_source);

  } else if (parameters[parameter].includes("utm_medium")) {
      var utm_medium = parameters[parameter].split(split_var)[1];
      console.log("utm_medium from event is " + utm_medium);

  } else if (parameters[parameter].includes("utm_content")) {
      var utm_content = parameters[parameter].split(split_var)[1];
      console.log("utm_content from event is " + utm_content);

  } else if (parameters[parameter].includes("utm_term")) {
      var utm_term = parameters[parameter].split(split_var)[1];
      console.log("utm_term from event is " + utm_term);


 form.vals({"fieldName1": utm_campaign,
           "fieldName2": utm_source,
          "fieldName3": utm_medium,
          "fieldName4": utm_content,
          "fieldName5": utm_term});