Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
544 views
in Technique[技术] by (71.8m points)

media player - How to open a video stream in an application from HTML

I'm working on a media-streaming software, and I already made apps for multiple platforms, but I'm now trying to port it to the web.

I know that I could transcode content into an mp4 or webm formats that browser supports, but I'd rather move the processing to client-side.

I can "open" a stream, where it asks me to open or save the file, but if I select "open", it downloads it fully and then opens in the media player of choice. The server does support content streaming, so it looks like a waste of having to download it fully to open it.

Is there a way I could open a video stream in a media player (vlc, mpv.io, mpc-hc, ...) without needing manual user intervention (copy-pasting the streaming URL into the player)?

question from:https://stackoverflow.com/questions/66048375/how-to-open-a-video-stream-in-an-application-from-html

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use this

     <param name="vid" value="http://server.example.com/video1.mpeg"/>
     <embed type="application/x-vlc-plugin" name="video"
     autoplay="no" loop="no" width="400" height="320"
     target="https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_1280_10MG.mp4" />
</object>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...