All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opentok.RtmpProperties Maven / Gradle / Ivy

Go to download

The OpenTok Java SDK lets you generate sessions and tokens for OpenTok applications. This version of the SDK also includes support for working with OpenTok 2.0 archives.

The newest version!
/**
 * OpenTok Java SDK
 * Copyright (C) 2025 Vonage.
 * http://www.tokbox.com
 * 
 * Licensed under The MIT License (MIT). See LICENSE file for more information.
 */
package com.opentok;


/**
 * Defines values for the RtmpProperties value of the BroadcastProperties parameter
 * of the
 * {@link OpenTok#startBroadcast(String, BroadcastProperties)}
 *
 * @see OpenTok#startBroadcast(String, BroadcastProperties) 
 */
public class RtmpProperties {
    private String id;
    private String serverUrl;
    private String streamName;

    private RtmpProperties(RtmpProperties.Builder builder) {
        this.id = builder.id;
        this.serverUrl = builder.serverUrl;
        this.streamName = builder.streamName;
    }
    /**
     * Use this class to create a RtmpProperties object.
     *
     * @see RtmpProperties
     */
    public static class Builder {
        private String id = null;
        private String serverUrl = null;
        private String streamName = null;

        /**
         * Call this method to set the ID of the RTMP stream (optional). If you specify an ID,
         * it will be included in the {@link Broadcast} object.
         *
         * @param id The stream ID
         *
         * @return The RtmpProperties.Builder object with the ID setting.
         */
        public RtmpProperties.Builder id(String id) {
            this.id = id;
            return this;
        }

        /**
         * Call this method to set the RTMP server URL. Note that OpenTok live streaming
         * supports RTMP and RTMPS.
         *
         * @param serverUrl The RTMP server URL
         *
         * @return The RtmpProperties.Builder object with the the RTMP server URL setting.
         */
        public RtmpProperties.Builder serverUrl(String serverUrl) {
            this.serverUrl = serverUrl;
            return this;
        }
        /**
         * Call this method to set the stream name, such as the YouTube Live stream name or the Facebook stream key.
         *
         * @param streamName The stream name.
         *
         * @return The RtmpProperties.Builder object with the stream name setting.
         */
        public RtmpProperties.Builder streamName(String streamName) {
            this.streamName = streamName;
            return this;
        }
        /**
         * Builds the RtmpProperties object.
         *
         * @return The RtmpProperties object.
         */
        public RtmpProperties build() {
            return new RtmpProperties(this);
        }
    }
    /**
     * Returns the ID of the broadcast stream
     */
    public String id() {
        return id;
    }
    /**
     *   Returns the RTMP server URL of the broadcast stream.
     */
    public String serverUrl() {
        return serverUrl;
    }

    /**
     * Returns the stream name of the broadcast, such as the YouTube Live stream name or
     * the Facebook stream key.
     */
    public String streamName() {
        return streamName;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy