Playing streaming video in WPF

前端 未结 2 500
暗喜
暗喜 2021-02-07 20:33

I\'ve written a WCF service that streams media files. I\'m now writing a WPF application that consumes this service and have only just found out that the MediaElement does not a

2条回答
  •  长发绾君心
    2021-02-07 20:44

    There is a way to achieve this using a pseudofiles, i.e. emulation of file system calls.

    When a path passed, a media player firstly opens the file (CreateFile is called), then reads data from it (ReadFile is called), moves position within the file (SetFilePointer is called).

    It just moves within the video file and reads required blocks.

    For example here described this approach (file calls just mapped to appropriate IStream methods: ReadFile -> Read, SetFilePointer -> Seek, CreateFile -> Clone etc.): http://boxedapp.com/encrypted_video_streaming.html

提交回复
热议问题