Hi Jack,
Downloaded the bitrate throttling module a couple of days back from here. Not sure what version it is.
I first tested it by browsing to a media file in a folder under the app root and I was able to set the rates in the IIS config manager. All worked as expected. What I see in the manager is a column for File Type, listing one file type in each item. These are the various video file types.
In our system each request for a video file is handled by a handler. After we authenticate the request is coming from our video player, we set the content type (as per the file type) and write the file out to the Output stream. This sent the file at full throttle, so I implemented my own logic using the video and audio bitrates to determine the throttle rates and set the server variables accordingly. All works as expected.
Note: Yesterday, as per Anil's suggestion, I changed the code such that the handler uses Response.TransmitFile instead of writing to the OutputStream.
The request url has a .aspx extension (yes, we simply use the .aspx extension and configure a handler by that path and name).
I'll try it again by removing our throttling logic to see what happens.
When you say "file handle" I assume one *has* to use transmitFile for the bitrate throttling to work automatically then? Also does the built in logic account for both audio and video bit rates?
This is what my applicationHost.config looks like
<
media> <bitrateThrottling enabled="true" minSendSize="5840">
<
throttleSettings><fileExtensionRules>
<
add fileExtension=".asf" settingType="media" initialBufferTimeSeconds="20" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" /><add fileExtension=".avi" settingType="media" initialBufferTimeSeconds="20" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" />
<
add fileExtension=".flv" settingType="media" initialBufferTimeSeconds="20" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" /><add fileExtension=".mov" settingType="media" initialBufferTimeSeconds="10" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" />
<
add fileExtension=".mp3" settingType="media" initialBufferTimeSeconds="10" throttleRatePercentage="100" connectionLimitGroup="AudioFiles" /><add fileExtension=".mp4" settingType="media" initialBufferTimeSeconds="10" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" />
<
add fileExtension=".m4v" settingType="media" initialBufferTimeSeconds="10" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" /><add fileExtension=".rm" settingType="media" initialBufferTimeSeconds="10" throttleRatePercentage="100" connectionLimitGroup="AudioFiles" />
<
add fileExtension=".rmvb" settingType="media" initialBufferTimeSeconds="10" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" /><add fileExtension=".wma" settingType="media" initialBufferTimeSeconds="20" throttleRatePercentage="100" connectionLimitGroup="AudioFiles" />
<
add fileExtension=".wmv" settingType="media" initialBufferTimeSeconds="20" throttleRatePercentage="100" connectionLimitGroup="VideoFiles" /></fileExtensionRules>
</
throttleSettings><connectionLimitGroups>
<
add name="VideoFiles" connectionLimit="0" /><add name="AudioFiles" connectionLimit="0" />
</
connectionLimitGroups><mediaFormats>
<
add fileExtension=".asf"><bitrateRules enabled="true">
<
add searchPattern="A1DCAB8C47A9CF118EE400C00C205365" searchPatternType="hexValue" searchRangeStart="0" searchRangeEnd="4096" dataOffset="84" dataType="uint32" endianness="littleEndian" unitBitPerSecond="1" /></bitrateRules>
</
add><add fileExtension=".wma">
<
bitrateRules enabled="true"><add searchPattern="A1DCAB8C47A9CF118EE400C00C205365" searchPatternType="hexValue" searchRangeStart="0" searchRangeEnd="4096" dataOffset="84" dataType="uint32" endianness="littleEndian" unitBitPerSecond="1" />
</
bitrateRules></add>
<
add fileExtension=".wmv"><bitrateRules enabled="true">
<
add searchPattern="A1DCAB8C47A9CF118EE400C00C205365" searchPatternType="hexValue" searchRangeStart="0" searchRangeEnd="4096" dataOffset="84" dataType="uint32" endianness="littleEndian" unitBitPerSecond="1" /></bitrateRules>
</
add><add fileExtension=".flv">
<
bitrateRules enabled="true"><add searchPattern="videodatarate" searchPatternType="stringValue" searchRangeStart="9" searchRangeEnd="4096" dataOffset="1" dataType="double" endianness="bigEndian" unitBitPerSecond="1000" />
<
add searchPattern="audiodatarate" searchPatternType="stringValue" searchRangeStart="9" searchRangeEnd="4096" dataOffset="1" dataType="double" endianness="bigEndian" unitBitPerSecond="1000" /></bitrateRules>
<
durationRule enabled="true"><duration searchPattern="duration" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="4096" dataOffset="1" dataType="double" endianness="bigEndian" />
<
timeScale constScale="1" /></durationRule>
</
add><add fileExtension=".mov">
<
durationRule enabled="true"><duration searchPattern="mvhd" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="65536" dataOffset="16" searchFrom="both" dataType="uint32" endianness="bigEndian" />
<
timeScale searchPattern="mvhd" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="65536" searchFrom="both" dataOffset="12" dataType="uint32" endianness="bigEndian" /></durationRule>
</
add><add fileExtension=".mp4">
<
durationRule enabled="true"><duration searchPattern="mvhd" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="65536" dataOffset="16" searchFrom="both" dataType="uint32" endianness="bigEndian" />
<
timeScale searchPattern="mvhd" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="65536" searchFrom="both" dataOffset="12" dataType="uint32" endianness="bigEndian" /></durationRule>
</
add><add fileExtension=".m4v">
<
durationRule enabled="true"><duration searchPattern="mvhd" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="65536" dataOffset="16" searchFrom="both" dataType="uint32" endianness="bigEndian" />
<
timeScale searchPattern="mvhd" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="65536" searchFrom="both" dataOffset="12" dataType="uint32" endianness="bigEndian" /></durationRule>
</
add><add fileExtension=".rmvb">
<
bitrateRules enabled="true"><add searchPattern="PROP" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="4096" dataOffset="6" dataType="uint32" endianness="bigEndian" unitBitPerSecond="1" />
</
bitrateRules></add>
<
add fileExtension=".rm"><bitrateRules enabled="true">
<
add searchPattern="PROP" searchPatternType="stringValue" searchRangeStart="0" searchRangeEnd="4096" dataOffset="10" dataType="uint32" endianness="bigEndian" unitBitPerSecond="1" /></bitrateRules>
</
add></mediaFormats>
</
bitrateThrottling>
</
media>