2

我有一个使用 Wowza Streaming Engine 4.1 的 ColdFusion 应用程序。我已经完成了通过 JW 播放器录制视频或音频和播放的所有集成。我正在使用 Wowza 的 VOD(视频点播)应用程序。

现在我想确保用户只能播放他们自己的视频。为此,我使用https://streamtoolbox.com/webservice-authentication-authorization

为此,它不需要数据库,因此我在 application.xml 文件属性部分添加了以下代码:

<!-- Example Application.xml part from the Properties and modules element -->

    <Modules>
        <Module>
            <Name>base</Name>
            <Description>Base</Description>
            <Class>com.wowza.wms.module.ModuleCore</Class>
        </Module>
        <Module>
            <Name>logging</Name>
            <Description>Client Logging</Description>
            <Class>com.wowza.wms.module.ModuleClientLogging</Class>
        </Module>
        <Module>
            <Name>flvplayback</Name>
            <Description>FLVPlayback</Description>
            <Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
        </Module> 
        <Module>
          <Name>Wrench module</Name>
          <Description>A module for user authentication and much more</Description>
          <Class>com.streamtoolbox.Wrench</Class>
        </Module>
    </Modules>
    <!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
    <Properties>
    <!-- Example Application.xml part from the Properties element -->
        <Property>
          <Name>wrench.db.driver</Name>
          <Value></Value> <!-- Setting to nothing to go into no-database mode -->
        </Property>
        <Property>
          <Name>wrench.token.resolver.url</Name>
          <Value>http://example.com/auth-token.cfm</Value>
          <!--Value>http://streamtoolbox.com/streaming/auth-nok.php</Value-->
        </Property>
        <Property>
          <Name>wrench.connect.authorization.url</Name>
          <Value>http://example.com/auth-ok.cfm</Value>
          <!--Value>http://streamtoolbox.com/streaming/auth-nok.php</Value-->
        </Property>
    </Properties>

我的 auth-ok CFM 文件仅包含以下代码:

{"result": "allow"}

我的 auth-token CFM 文件仅包含以下代码:

{"username":"john"}

我重新启动了 Wowza 应用程序并检查了视频,但视频出现以下错误:

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()

我在 ColdFusion 中将文本记录到文件中,以查看它是否正在向 cfm 文件发送请求。但是什么也没找到。所以看来我在 application.xml 文件中没有正常运行的任何问题。

谁能让我知道我做错了什么?

4

1 回答 1

1

在我看来,您还没有配置令牌解析器网络wrench.token.resolver.url服务(或者您也可以为此使用数据库),所以基本上发生的事情是连接进入,Wrench 没有定义的方法来确定谁属于令牌,然后它不会调用授权网络服务,因为这将需要传递用户名。您需要实现一个简单的 web 服务,它返回令牌的用户名,格式如下(更多详细信息在文档中):

{"username":"john"}
于 2017-03-06T08:37:35.403 回答