0

I'm using Wistia's Turnstile to capture e-mail in the end of a video. The problem is that I would like to redirect to another page after the user clicks submit. The message would have a request to check the e-mail to confirm the double opt-in.

I have tried using 2 Embed types with no sucess.

IFrame:

<iframe src="//fast.wistia.net/embed/iframe/7zu6ze7v40?videoFoam=true" allowtransparency="true" frameborder="0" scrolling="yes" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen id="my_wistia_video"></iframe>
<script src="//fast.wistia.net/assets/external/iframe-api-v1.js"></script>
<script>
  wistiaEmbed = document.getElementById("my_wistia_video").wistiaApi;
  wistiaEmbed.bind("conversion", function(type, val) {
  window.location.href == "http://the_page";
});
</script>

API:

<div id="wistia_7zu6ze7v40" class="wistia_embed" style="width:640px;height:508px;">&nbsp;</div>
<script charset="ISO-8859-1" src="//fast.wistia.com/assets/external/E-v1.js"></script>
<script>
  wistiaEmbed = Wistia.embed("7zu6ze7v40", {
    videoFoam: true
  });
  wistiaEmbed.bind("conversion", function(type, val) {
    window.location.href == "http://the_page";
  });
</script>

Any hints or advices?

2 Answers2

1

Looks like you're using a comparison operator (a boolean operator) there with the ==, and you'll want to use a single = in that place to simply set the window.location.href in your example. If you're curious about more on comparison operators, check this W3 page.

Anyhow, I'd recommend this embed:

<div id="wistia_7zu6ze7v40" class="wistia_embed" style="width:640px;height:508px;">&nbsp;</div>
<script charset="ISO-8859-1" src="//fast.wistia.com/assets/external/E-v1.js"></script>
<script>
  wistiaEmbed = Wistia.embed("7zu6ze7v40", {
videoFoam: true
  });
  wistiaEmbed.bind("conversion", function(type, val) {
    window.location.href = "http://the_page";
  });
</script>
Munson
  • 11
  • 2
  • Thanks! Unfortunately it hasn't solved the problem. The API version don't let me insert the e-mail in the field And the Iframe version don't show the Turnstile. Any idea what is happening? – Claudio Shigueo Watanabe Jun 20 '14 at 16:40
0

I couldn't find the answer of my question but I solved the problem in another way that may be even better depending on the case.

The idea is to include a form on the page that the video is and only show the form when the video ends. The div of the form must have a "display: none;" and this code will make it appear when the video ends:

<script>
  wistiaEmbed = document.getElementById("my_wistia_video").wistiaApi;
  wistiaEmbed.bind("end", function() {  
    document.getElementById("div_id").style.display = 'block';
  });
</script>

In this case, I stopped using turnstile. I'm using call to action although I believe that editing the video could be another solution.