Search code examples
apirestwowza

mediaReaderRandomAccessReaderClass issue with wowza restful api


I am using WowzaStreamingEngine 4.4.1 at Ubuntu 14.04. I used restful api and created vod application (restful_vod) as in examples, it didn't work didn't stream vod files. That's why, I compare application.xml files of default vod application and restful_vod application. There is a difference between MediaReader properties. Default vod application has no property at there but restful_vod has below:

<MediaReader>
  <!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
  <Properties>
    <Property>
      <Name>randomAccessReaderClass</Name>
      <Value></Value>
      <Type>String</Type>
    </Property>
  </Properties>
</MediaReader>

When I removed randomAccessReaderClass named property, it started to work. I realized mediaReaderRandomAccessReaderClass parameter manage its value at restful api side. But I couldn't find a way to prevent adding it while using restful api. I tried not setting mediaReaderRandomAccessReaderClass value and also setting mediaReaderRandomAccessReaderClass false, null and empty string.

Is there any way to prevent adding it or a default working value for this?

Thanks.


Solution

  • You can set a default mediaReaderRandomAccessReaderClass by setting it as follows: "mediaReaderRandomAccessReaderClass": ""

    In your resulting Application.xml file, the MediaReader container would then be blank, which would indicate that it would use the default value:

    <MediaReader>
        <!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
        <Properties>
        </Properties>
    </MediaReader>
    

    A working REST API command to create a VOD file, for example, would look like this.

    curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod -d'
    {
       "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod",
       "version": "1462342478287",
       "name": "testvod",
       "appType": "VOD",
       "description": "Test VOD via REST.",
       "applicationTimeout": 0,
       "pingTimeout": 0,
       "repeaterQueryString": "",
       "clientStreamReadAccess": "*",
       "avSyncMethod": "senderreport",
       "maxRTCPWaitTime": 12000,
       "httpStreamers": [
          "cupertinostreaming",
          "smoothstreaming",
          "sanjosestreaming",
          "mpegdashstreaming"
       ],
       "mediaReaderRandomAccessReaderClass": "",
       "httpOptimizeFileReads": false,
       "mediaReaderBufferSeekIO": false,
       "captionLiveIngestType": "",
       "vodTimedTextProviders": [
          "vodcaptionprovidermp4_3gpp"
       ],
       "securityConfig": {
          "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod/security",
          "secureTokenVersion": 0,
          "clientStreamWriteAccess": "*",
          "publishRequirePassword": true,
          "publishPasswordFile": "",
          "publishRTMPSecureURL": "",
          "publishIPBlackList": "",
          "publishIPWhiteList": "",
          "publishBlockDuplicateStreamNames": false,
          "publishValidEncoders": "",
          "publishAuthenticationMethod": "digest",
          "playMaximumConnections": 0,
          "playRequireSecureConnection": false,
          "secureTokenSharedSecret": "",
          "secureTokenUseTEAForRTMP": false,
          "secureTokenIncludeClientIPInHash": false,
          "secureTokenHashAlgorithm": "",
          "secureTokenQueryParametersPrefix": "",
          "secureTokenOriginSharedSecret": "",
          "playIPBlackList": "",
          "playIPWhiteList": "",
          "playAuthenticationMethod": "none"
       },
       "streamConfig": {
          "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod/streamconfiguration",
          "streamType": "default",
          "storageDir": "${com.wowza.wms.context.VHostConfigHome}/content",
          "createStorageDir": false,
          "storageDirExists": true,
          "keyDir": "${com.wowza.wms.context.VHostConfigHome}/keys",
          "httpRandomizeMediaName": false
       },
       "modules": {
          "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod/modules",
          "moduleList": [
             {
                "order": 0,
                "name": "base",
                "description": "Base",
                "class": "com.wowza.wms.module.ModuleCore"
             },
             {
                "order": 1,
                "name": "logging",
                "description": "Client Logging",
                "class": "com.wowza.wms.module.ModuleClientLogging"
             },
             {
                "order": 2,
                "name": "flvplayback",
                "description": "FLVPlayback",
                "class": "com.wowza.wms.module.ModuleFLVPlayback"
             },
             {
                "order": 3,
                "name": "ModuleCoreSecurity",
                "description": "Core Security Module for Applications",
                "class": "com.wowza.wms.security.ModuleCoreSecurity"
             }
          ]
       }
    }'