• 大小: 203KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-12
  • 语言: Java
  • 标签: juv  rtmp  android  

资源简介

利用juv-rtmp-client实现视频采集,并实时发送到red服务器。《破解某国外收费的RTMP Client并成功在Android和Java上调用》 一文的源代码

资源截图

代码片段和文件信息

package com.weedong.net.rtmp;
/**
 * Copyright (c) 2006 - 2008 Smaxe Ltd (www.smaxe.com).
 * All rights reserved.
 */

import java.util.Map;

import com.smaxe.uv.client.INetConnection;
import com.smaxe.uv.client.INetStream;
import com.smaxe.uv.client.License;
import com.smaxe.uv.client.NetStream;
import com.smaxe.uv.client.NetConnection;
import com.weedong.net.rtmp.UltraNetConnection;
import com.weedong.net.rtmp.UltraNetStream;
/**
 * ExPlayStream - {@link UltraNetConnection} usage example.
 * 

 Note: The example shows how to ‘play‘ server stream. The played stream
 * is saved to the local flv file.
 * 
 * @author Andrei Sochirca
 */
public final class Example extends object
{
    /**
     * Entry point.
     * 
     * @param args
     */
    public static void main(final String[] args)
    {
        // NOTE:
        // you can get Evaluation Key at:
        // http://www.smaxe.com/order.jsf#request_evaluation_key
        // or buy at:
        // http://www.smaxe.com/order.jsf
//        License.setKey(“24F11-06023-BE741-00D3A-798B8“);
        
        Example app = new Example();
        
        app.start();
    }
    
    /**
     * NetConnectionListener - {@link UltraNetConnection} listener implementation.
     */
    public class NetConnectionListener extends NetConnection.ListenerAdapter
    {
        /**
         * Constructor.
         */
        public NetConnectionListener()
        {
        }
        
        @Override
        public void onAsyncError(final INetConnection source final String message final Exception e)
        {
            System.out.println(“NetConnection#onAsyncError: “ + message + “ “ + e);
        }
        
        @Override
        public void onIOError(final INetConnection source final String message)
        {
            System.out.println(“NetConnection#onIOError: “ + message);
        }
        
        @Override
        public void onNetStatus(final INetConnection source final Mapject> info)
        {
            System.out.println(“NetConnection#onNetStatus: “ + info);
            
            final object code = info.get(“code“);
            
            if (NetConnection.CONNECT_SUCCESS.equals(code))
            {
            }
            else
            {
                disconnected = true;
            }
        }
    }
    
    
    // fields
    private volatile boolean disconnected = false;
    
    /**
     * Constructor.
     */
    public Example()
    {
    }
    
    /**
     * Starts the example.
     */
    public void start()
    {
        final UltraNetConnection connection = new UltraNetConnection();
        
        connection.addEventListener(new NetConnectionListener());
connection.client(this);
        
        connection.connect(“rtmp://192.168.1.247/chatapp“ 81330);
        
        // wait till connected
        while (!connecti


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      10102  2012-05-11 17:14  UltraNetStream.java

     文件     235625  2012-05-11 17:14  juv-rtmp-client-1.5.10.jar

     文件       4513  2012-05-11 17:14  Example.java

     文件       9102  2012-05-11 17:14  UltraNetConnection.java

----------- ---------  ---------- -----  ----

               259342                    4


评论

共有 条评论