向我的网站用户私有视频-Wowza Wrench



我有一个使用WOWZA流动引擎4.1的ColdFusion应用程序。我已经完成了所有集成,以录制JW Player的视频或音频和播放。我正在使用WOWZA的VOD(视频按需)应用。

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

为此,它不需要数据库,因此我在我的应用程序中添加了以下代码。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"}

我的身份cfm文件仅包含以下代码:

{"username":"john"}

我已经重新启动了WOWZA应用程序并检查了视频,但是视频给出以下错误:

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

我正在将文本记录到文件中,以查看该文件是否向CFM文件发送请求。但是什么都没有找到。因此,似乎我在application.xml文件中有任何问题,该文件无法正常运行。

有人可以让我知道我做错了什么吗?

在我看来,您尚未使用wrench.token.resolver.url配置一个令牌解析器网服务(或者您也可以使用数据库),所以基本上发生的是连接进来,扳手没有一个定义的方法来弄清楚谁属于令牌,然后不会拨打授权网络服务,因为这将需要通过用户名。您需要实现一个简单的Web服务,该网络服务以下面的格式返回令牌的用户名(文档中的更多详细信息):

{"username":"john"}

最新更新