Search in sources :

Example 6 with R5AudioController

use of com.red5pro.streaming.media.R5AudioController in project streaming-android by red5pro.

the class SubscribeTest method Subscribe.

public void Subscribe() {
    // Create the configuration from the tests.xml
    R5Configuration config = new R5Configuration(R5StreamProtocol.RTSP, TestContent.GetPropertyString("host"), TestContent.GetPropertyInt("port"), TestContent.GetPropertyString("context"), TestContent.GetPropertyFloat("subscribe_buffer_time"));
    config.setLicenseKey(TestContent.GetPropertyString("license_key"));
    config.setBundleID(getActivity().getPackageName());
    R5Connection connection = new R5Connection(config);
    // setup a new stream using the connection
    subscribe = new R5Stream(connection);
    // Some devices can't handle rapid reuse of the audio controller, and will crash
    // Recreation of the controller assures that the example will always be stable
    subscribe.audioController = new R5AudioController();
    subscribe.audioController.sampleRate = TestContent.GetPropertyInt("sample_rate");
    subscribe.client = this;
    subscribe.setListener(this);
    // show all logging
    subscribe.setLogLevel(R5Stream.LOG_LEVEL_DEBUG);
    // display.setZOrderOnTop(true);
    display.attachStream(subscribe);
    display.showDebugView(TestContent.GetPropertyBool("debug_view"));
    subscribe.play(TestContent.GetPropertyString("stream1"));
}
Also used : R5Configuration(com.red5pro.streaming.config.R5Configuration) R5Connection(com.red5pro.streaming.R5Connection) R5Stream(com.red5pro.streaming.R5Stream) R5AudioController(com.red5pro.streaming.media.R5AudioController)

Example 7 with R5AudioController

use of com.red5pro.streaming.media.R5AudioController in project streaming-android by red5pro.

the class SubscribeCluster method beginSubscribe.

protected void beginSubscribe() {
    R5Configuration config = new R5Configuration(R5StreamProtocol.RTSP, edgeIP, TestContent.GetPropertyInt("port"), TestContent.GetPropertyString("context"), TestContent.GetPropertyFloat("subscribe_buffer_time"));
    config.setLicenseKey(TestContent.GetPropertyString("license_key"));
    config.setBundleID(getActivity().getPackageName());
    R5Connection connection = new R5Connection(config);
    // setup a new stream using the connection
    subscribe = new R5Stream(connection);
    subscribe.setListener(this);
    subscribe.audioController = new R5AudioController();
    subscribe.audioController.sampleRate = TestContent.GetPropertyInt("sample_rate");
    // show all logging
    subscribe.setLogLevel(R5Stream.LOG_LEVEL_DEBUG);
    // find the view and attach the stream
    display.attachStream(subscribe);
    display.showDebugView(TestContent.GetPropertyBool("debug_view"));
    subscribe.play(TestContent.GetPropertyString("stream1"));
    edgeShow = new TextView(display.getContext());
    FrameLayout.LayoutParams position = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
    edgeShow.setLayoutParams(position);
    ((FrameLayout) display.getParent()).addView(edgeShow);
    edgeShow.setText("Connected to: " + edgeIP, TextView.BufferType.NORMAL);
    edgeShow.setBackgroundColor(Color.LTGRAY);
}
Also used : R5Configuration(com.red5pro.streaming.config.R5Configuration) R5Connection(com.red5pro.streaming.R5Connection) R5Stream(com.red5pro.streaming.R5Stream) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) R5AudioController(com.red5pro.streaming.media.R5AudioController)

Example 8 with R5AudioController

use of com.red5pro.streaming.media.R5AudioController in project streaming-android by red5pro.

the class SubscribeAuthTest method Subscribe.

public void Subscribe() {
    String auth = "username=" + TestContent.GetPropertyString("username") + ";";
    auth += "password=" + TestContent.GetPropertyString("password") + ";";
    // Create the configuration from the tests.xml
    R5Configuration config = new R5Configuration(R5StreamProtocol.RTSP, TestContent.GetPropertyString("host"), TestContent.GetPropertyInt("port"), TestContent.GetPropertyString("context"), TestContent.GetPropertyFloat("subscribe_buffer_time"), auth);
    config.setLicenseKey(TestContent.GetPropertyString("license_key"));
    config.setBundleID(getActivity().getPackageName());
    R5Connection connection = new R5Connection(config);
    // setup a new stream using the connection
    subscribe = new R5Stream(connection);
    subscribe.audioController = new R5AudioController();
    subscribe.audioController.sampleRate = TestContent.GetPropertyInt("sample_rate");
    subscribe.client = this;
    subscribe.setListener(this);
    // show all logging
    subscribe.setLogLevel(R5Stream.LOG_LEVEL_DEBUG);
    // display.setZOrderOnTop(true);
    display.attachStream(subscribe);
    display.showDebugView(TestContent.GetPropertyBool("debug_view"));
    subscribe.play(TestContent.GetPropertyString("stream1"));
}
Also used : R5Configuration(com.red5pro.streaming.config.R5Configuration) R5Connection(com.red5pro.streaming.R5Connection) R5Stream(com.red5pro.streaming.R5Stream) R5AudioController(com.red5pro.streaming.media.R5AudioController)

Aggregations

R5Connection (com.red5pro.streaming.R5Connection)8 R5Stream (com.red5pro.streaming.R5Stream)8 R5Configuration (com.red5pro.streaming.config.R5Configuration)8 R5AudioController (com.red5pro.streaming.media.R5AudioController)8 FrameLayout (android.widget.FrameLayout)2 TextView (android.widget.TextView)2 Handler (android.os.Handler)1 View (android.view.View)1 R5ConnectionListener (com.red5pro.streaming.event.R5ConnectionListener)1 R5VideoView (com.red5pro.streaming.view.R5VideoView)1