I have a readonly System.IO.Stream implementation that is not seekable (and its Position always returns 0). I need to send it to a consumer that do
Another solution might be to create your own stream class which wraps the other stream. Implement Seek as a NOP.
class MyStream : Stream
{
public MyStream(Stream baseStream) { this.baseStream = baseStream; }
private Stream baseStream;
// Delegate all operations except Seek/CanSeek to baseStream
public override bool CanSeek { get { return true; } }
public override long Seek(long offset, SeekOrigin origin) { return baseStream.Position; }
}
If the player is seeking for no good reason, this might just work.