简体   繁体   English

视频结束后重定向

[英]Redirect after a video has ended

I'm creating eLearning content in an application called MadCap Flare.我正在一个名为 MadCap Flare 的应用程序中创建电子学习内容。
I'm trying to get the intro bumper video to play and then after the video is done it moves on to another page (we will say url for this forum).我正在尝试播放介绍性保险杠视频,然后在视频播放完毕后转到另一个页面(我们会说这个论坛的 url)。 Here is my code, and I cannot get this to work at all.这是我的代码,我根本无法让它工作。 The video plays but it will not move on to the url.视频播放,但它不会移动到 url。 When I view source code I see it put in a CDAT error.当我查看源代码时,我看到它出现了 CDAT 错误。

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" style="mc-template-page: 
url('..\Resources\TemplatePages\Home-Page.flmsp');">
    <head>
    </head>
    <body>
        <p>
            <video MadCap:HTML5Video="true" MadCap:Param_controls="false" MadCap:Param_loop="false" MadCap:Param_muted="false" src="../Resources/Multimedia/Aruba_Coral.webm" MadCap:Param_autoplay="true">
            </video>
        <script type="text/javascript">
        var video1 = document.getElementsByTagName('video1')[0];
                
        video1.onended = function(e) {
        window.location.replace('http://www.hpe.com');
        }
        </script>
        </p>
    </body>
</html>

You forgot to add the id attribute to the video tag.您忘记将 id 属性添加到 video 标签。 Try this :尝试这个 :

<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" style="mc-template-page: 
url('..\Resources\TemplatePages\Home-Page.flmsp');">
    <head>
    </head>
    <body>
        <p>
            <video id="video1" MadCap:HTML5Video="true" MadCap:Param_controls="false" MadCap:Param_loop="false" MadCap:Param_muted="false" src="../Resources/Multimedia/Aruba_Coral.webm" MadCap:Param_autoplay="true">
            </video>
            <script type="text/javascript">
                var video1 = document.getElementById('video1');
                
                video1.onended = function(e) {
                    window.location.replace('http://www.hpe.com');
                }
            </script>
        </p>
    </body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM