从通话的Andr​​oid应用一个wowza服务器? [英] Call a wowza server from android app?

查看:203
本文介绍了从通话的Andr​​oid应用一个wowza服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一些应用程序,将来自wowza播放流。
那部分就可以了。但接下来,我需要在应用中的一些选项,将与wowza服务器comunicate。例如如何调用wowza服务器的一些方法,如何调用的onConnect方法......如何从wowza从应用程序连接并保持连接,直到我叫onDisconnect方法?
如果有人有一些信息,我将非常感激......在此先感谢...

I'm trying to make some app that will play the stream from wowza.
That part is ok. But next i need to have some option in app, that will comunicate with wowza server. For example how to call a wowza server some method, how to call onConnect method ... How to connect from wowza from a app and stay connected until i call a onDisconnect method???
If somebody have some info i will be very grateful... Thanks in advance...

VideoView.setVideoPath("some path") 

做的伎俩玩...

does the trick for playing...

推荐答案

您调用使用调用方法Wowza模块中的HTTPProvider(http://www.wowza.com/forums/content.php?30-httpproviders) 。这给你的Wowza模块中的网址,你的应用程序将能够通过HTTP调用。

You call call a method in a Wowza module using a HTTPProvider (http://www.wowza.com/forums/content.php?30-httpproviders). This gives you a url in your Wowza module which your app will be able to call over HTTP.

因此​​,例如,你有你的Wowza模块的默认下运行:

So for example you have your Wowza module running under the default of:

http://localhost:1935.

您可以将HTTPProvider添加到您的VHost.xml,如:

You can add a HTTPProvider to your VHost.xml, such as:

<HTTPProvider>
    <BaseClass>com.mycompany.wms.module.SomeModule</BaseClass>
    <RequestFilters>logout*</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
</HTTPProvider>

这会让你调用一个网址,如:

This would let you call a url such as:

http://localhost:1935/logout?id=123456789

在Java的code你的模块,则需要实现从中创建onHTT prequest方法HTTProvider2Base。在查询字符串变量(因此在此示例:?编号= 123456789)可被用于该方法中。您也可以拨打您的模块的方法从这里开始。

In the Java code for your module, you need implement HTTProvider2Base from which you create a onHTTPRequest method. The variables in the query string (so in this example: ?id=123456789) can be used in the method. You can also call methods in your module from here.

这将使用这个调用的一个例子Java类如下:

An example Java class that would use this call is as follows:

package com.mycompany.wms.module;

import com.wowza.wms.http.HTTProvider2Base;
import com.wowza.wms.http.IHTTPRequest;
import com.wowza.wms.http.IHTTPResponse;
import com.wowza.wms.logging.WMSLogger;
import com.wowza.wms.logging.WMSLoggerFactory;
import com.wowza.wms.vhost.IVHost;

public class SomeModule extends HTTProvider2Base {

public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
    //Get the user
    String userId = req.getParameter("id");
    getLogger().info("Logging out user: " + userId );       

    logoutUser(userId);
}

private void logoutUser(String userId){
    //Do stuff here...
}

private WMSLogger getLogger(){
    return WMSLoggerFactory.getLogger(SomeModule.class);
}
}

一些陷阱:


  • 作用域在onHTT prequest似乎是您的实例之外,所以要小心在模块的一个实例访问属性。

  • 我不得不注释掉HTTPProvider节点在它HTTPServerVersion让我的一个工作。它似乎覆盖所有其他HTTPProviders在我的版本Wowza的。

  • 我也有从IDE运行Wowza不是通过Visual Studio中拿起电话到url麻烦。有一次,我把我变成了服务的版本,通话正常工作。

我建立的应用程序。这主要是基于这篇文章中的谈话了所做的:的http://www.wowza.com/forums/content.php?182-HTTPProvider-that-returns-detail-server-info

The app I built which did this was largely based on the conversation in this article: http://www.wowza.com/forums/content.php?182-HTTPProvider-that-returns-detail-server-info

这篇关于从通话的Andr​​oid应用一个wowza服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆