This file provides tools to manipulate and preview all Wistia embed types in the Wistia app.
Check out the annotated source.
LabTools requires jQuery and Wistia's E-v1 script.
<script src="http://https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://fast.wistia.com/static/E-v1.js"></script>
<script src="labtools.js"></script>
Take an embed code and parse it so we can query or manipulate it.
var embedCode = Wistia.EmbedCode.parse("[embed code string]");
If you're checking against a string:
Wistia.EmbedCode.isIframe("[embed code string]");
Wistia.EmbedCode.isPopover("[embed code string]");
Wistia.EmbedCode.isApi("[embed code string]");
If you want to see what type was returned by Wistia.EmbedCode.parse:
embedCode instanceof Wistia.IframeEmbedCode
embedCode instanceof Wistia.PopoverEmbedCode
embedCode instanceof Wistia.ApiEmbedCode
embedCode.setOption("plugin.my-awesome-plugin.on", true);
embedCode.extendOption("plugin.my-awesome-plugin", {
on: true,
awesome: "yes"
});
embedCode.removeOption("plugin.my-awesome-plugin");
$("textarea#embed_code").val(embedCode.toString());
There should be a div with id="embed_code_preview" somewhere on the page.
embedCode.previewInElem("embed_code_preview");
For more advanced usage, please take a look at the annotated source.