简体   繁体   中英

How can Tomcat and Media Servers work together?

I am planning on building a Java web app that will have lots of integrated video (original content) being streamed from our backend. I'm having a difficult time seeing the forest through the trees: I want all non-media, client-side content (HTML, CSS, JS, etc.) to be served from my Tomcat server, but I want the media content (videos) to be served from an actual media server like Red5 or Wowza.

So my problem is: on the backend, how do you make 1 request for http://myapp.example.org/videos/vid2449 return content from 2 servers (Tomcat and the media server)?

Req #1 returns stuff for views etc from TC. This response includes ffollowing

Link on where to get media meta data bound to that session/request. A collection of playables

Link on where to get a session Mgr player

JS on client does follow with response

Bootstrap player

Marshall media info is links to streams

Bootstrap wrapper for player state ( Idle Paused PLaying Buffering )

Start player on a stream from list of links which will require a second network connection ( http stream )

Manage player state

Manage socket stream

Manage player ui controls events

Player callbacks

--EDIT--

if your media is self hosted as opposed to coming from the cloud, you can use apache 'ajp' connectors or whatever and have single server running Apache in front of the connectors and infront of TC. Apache will stream the static media files while TC handles other stuff and it all runs from the some domain host.

  • You can also serve the two things on two different ports

Web page generated from http://yourserver.com/videos returns

<html>
   <a href="http://yourserver.com:1935/app/stream/video.m3u8">Link to stream</a>
   <!-- or you can embed a player and feed it 
</html>

You didn't specify the type of media being served except in one comment you mention m3u8 which indicates HLS. Your tags indicate you're going to stream Flash media. Red5 includes an embedded tomcat server, so everything can be served from one server. Your given url could be handled with JavaScript and a swf player; simply read the video id and pass it to the player.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM