【发布时间】:2013-01-23 14:57:28
【问题描述】:
我有一个自定义播放器可以播放录音(仅音频)。如果音频文件很长,NetStream 类就不会很好地寻找它。我发现在 16776 秒 (04:39:36) 之后,NetStream 搜索功能再次从文件开头开始。这是最短的伪代码:
package com.name.player
{
import flash.net.NetConnection;
import flash.net.NetStream;
...
public class StreamingPlayer extends Sprite
{
public var maStream:NetStream;
...
public function aFunction
{
maStream = new NetStream( maConnection );
maStream.inBufferSeek = true; // ==> Generates compile error:
//Error: Access of possibly undefined property inBufferSeek through a reference with static type flash.net:NetStream.
// [mxmlc]
// [mxmlc] maStream.inBufferSeek = true;
// [mxmlc] ^
maStream.play('sName', 0, -1, true);
// Now try these (one at a time)
maStream.seek(16775); // Seeks to the desired position and plays the file till the end
maStream.seek(16776); // Seeks at second 0 ( begining )
maStream.seek(16778); // Seeks at second 0 ( begining )
maStream.seek(16780); // Seeks at second 3
maStream.seek(16786); // Seeks at second 9
maStream.seek(16796); // Seeks at second 19
...
}
...
}
...
}
我尝试了不同的格式(speex、wav)/代码/比特率:
- RIFF(小端)数据、WAVE 音频、ITU G.711 A-law、单声道 8000 Hz
- RIFF(小端序)数据、WAVE 音频、Microsoft PCM、16 位、单声道 44100 Hz
- Ogg 数据,Speex 音频
文件大小或总长度无关紧要,我尝试在 1.1 - 1500 MB 和 04:40:00(17000 秒)到 14:56:41(53801 秒)之间。
我正在为新浏览器使用 html5,但我们仍然需要支持旧浏览器(在某些无法更新安装新软件的客户端 PC 上,所以我需要一个 Flash 解决方案,因为 Flash 已经安装并且沿着 IE6 运行 :( )。
问:
是我做错了什么还是 NetStreamer 存在限制,如果有什么解决方案,我必须能够播放这些长文件吗?
附:这是我第一次使用 flash,所以如果您有答案/评论,请尝试更明确一点。
编辑:在 Adobe ID 3492103 中添加了错误。
编辑:
我有一个同事在测试流服务器,他发现了一些有趣的日志:
// This is lower than 16776 seconds, and works
01-26 13:02:14.277 RtmpProtocol:891 [ID-007] Seeking to 1594380
...
01-26 13:02:14.279 FileReaderWav:194 [ID-007] <Stream0001> Seeking to 15943804 sf_seek 127550432
...
01-26 13:02:16.250 FileReaderWav:230 [ID-007] <Stream0001> Current position: 15943824
// This is when it plays from the beginning (seeking after 16776 seconds)
// according to the log it should just play at the desired position, but it's not
01-26 13:02:23.294 RtmpProtocol:891 [ID-007] Seeking to 16990012
01-26 13:02:23.303 FileReaderWav:194 [ID-007] <Stream0001> Seeking to 16990012 sf_seek 135920096
01-26 13:02:23.463 FileReaderWav:230 [ID-007] <Stream0001> Current position: 16990032
我们可能在流服务器中遇到问题,一些 INTEGER 转换或类似的东西。如果我得到更多信息,我会更新。
谢谢
【问题讨论】:
-
文档中没有任何内容表明 17000+ 不是可接受的值,并且没有为 NetStream.seek() 记录错误。也许你发现了一个新的?我怀疑很多用户之前尝试过播放这么长的文件
-
@LeeBurrows 有什么方法可以填补错误吗?从开发的角度来看,AFAIK flash 或多或少已经死了,但我认为应该让他们知道。
-
可以在此处提交错误:bugs.adobe.com。 Flash 肯定没有死。可能是 Flash 网站,但不是 Flash 本身