简体   繁体   English

Tomcat和媒体服务器如何一起工作?

[英]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. 我正计划构建一个Java Web应用程序,该应用程序将从我们的后端流式传输许多集成视频(原始内容)。 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. 我很难穿过树林看森林:我想从我的Tomcat服务器提供所有非媒体,客户端内容(HTML,CSS,JS等),但是我希望媒体内容(视频)从实际的媒体服务器(如Red5或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)? 所以我的问题是:在后端,您如何向2个服务器(Tomcat和媒体服务器)的1个请求http://myapp.example.org/videos/vid2449返回内容?

Req #1 returns stuff for views etc from TC. 请求#1从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 链接到哪里可以获取会话Mgr播放器

JS on client does follow with response 客户上的JS确实会回应

Bootstrap player 引导播放器

Marshall media info is links to streams 马歇尔媒体信息是流的链接

Bootstrap wrapper for player state ( Idle Paused PLaying Buffering ) 播放器状态的Bootstrap包装器(空闲暂停播放缓冲)

Start player on a stream from list of links which will require a second network connection ( http stream ) 从需要第二个网络连接的链接列表中的流中启动播放器(http流)

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'ajp'连接器或其他任何方式,并且在连接器和TC的前端具有运行Apache的单个服务器。 Apache will stream the static media files while TC handles other stuff and it all runs from the some domain host. 当TC处理其他内容时,Apache将流式传输静态媒体文件,并且所有这些文件都从某个域主机运行。

  • You can also serve the two things on two different ports 您还可以在两个不同的端口上为这两个事情服务

Web page generated from http://yourserver.com/videos returns http://yourserver.com/videos生成的网页返回

<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. 您没有指定要提供的媒体类型,只是在一个注释中提到了表示HLS的m3u8。 Your tags indicate you're going to stream Flash media. 您的标签指示您将流式传输Flash媒体。 Red5 includes an embedded tomcat server, so everything can be served from one server. Red5包含一个嵌入式的tomcat服务器,因此所有内容都可以通过一台服务器提供。 Your given url could be handled with JavaScript and a swf player; 您指定的网址可以使用JavaScript和swf播放器进行处理; simply read the video id and pass it to the player. 只需读取视频ID并将其传递给播放器即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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