Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api
Interface MSRPPlayer

All Superinterfaces:
MediaParticipant, Participant, Player

public interface MSRPPlayer
extends Player

A participant that is used to send large files from container to the other participants in a MSRP communication.

Application should use the MSRPConference together with MSRPPlayer. For example:

 CommunicationSession sess = ...;
 MSRPConferen msrpConf = sess.createMSRPConference("confName");
 MSRPPlayer msrpPlayer =
  sess.createParticipant(MSRPPlayer.class, "msrpPlayer");
 msrpPlayer.addDataReceiver(receiver1);
 msrpPlayer.addDataReceiver(receiver2);
 msrpConf.addParticipant(msrpPlayer);
 URI uri = ...;
 msrpPlayer.start(uri);
 

All these receivers will be added to the MSRPConference as participants.

Using this participant, it is also possible to send a file directly from the client web browser to the MSRP capable phones, like this:

 public class PlayerServlet extends HttpServlet{

      @Override
      protected void doPost(HttpServletRequest req, HttpServletResponse resp) {

         MSRPPlayer msrpPlayer = sess.createParticipant(MSRPPlayer.class, "player");
         msrpConf.addParticipant(msrpPlayer);
         msrpPlayer.addDataReceiver(receiver1);
         ...
         msrpPlayer.addDataReceiver(receiverN);
         player.start(request.getInputStream(), request.getContentType(),
                    request.getContentLength());
      }
 }
 

The corresponding HTML page snippet will be like this:

 <form METHOD=POST ENCTYPE="multipart/form-data" ACTION="PlayerServlet">
       <input name="myfile" type="file">
       <input name="submit" type="submit">
 </form>
 

Method Summary
 void addDataReceiver(UserParticipant name)
          Use this method to add data receivers to the MSRPPlayer before invoke it's start(...) method.
 void start(InputStream mediaStream, String contentType, long contentLength)
          Send the contents of the stream to the participants using MSRP protocol.
 void start(String... streams)
          Start sending the media from the specified location(s) using the MSRP protocol.
 void start(URI... streams)
          Start sending the media from the specified location(s) using MSRP protocol.

 

Methods inherited from interface com.oracle.sft.api.Player
getStreams

 

Methods inherited from interface com.oracle.sft.api.MediaParticipant
stop

 

Methods inherited from interface com.oracle.sft.api.Participant
addAgent, getAgent, getAgents, getExtension, getJoinable, getName, getNickName, removeAgent, setName, setNickName

 

Method Detail

start

void start(InputStream mediaStream,
           String contentType,
           long contentLength)
Send the contents of the stream to the participants using MSRP protocol. The method returns after the sending is finished.
Parameters:
mediaStream - Stream containing the media content.
contentType - Type of the media
contentLength - Length of the media if known, -1 otherwise.

start

void start(URI... streams)
Start sending the media from the specified location(s) using MSRP protocol.

Notice: only support one stream.

Specified by:
start in interface Player
Parameters:
streams - List of media locations to be played.

start

void start(String... streams)
Start sending the media from the specified location(s) using the MSRP protocol. This is equivalent to calling play(URI.create(stream)); The parameter format should be standard File URI format, e.g. "file:///tmp/music.au" for Linux OS or "file:///c:/tmp/music.au" for Windows OS

Notice: only support one stream.

Specified by:
start in interface Player
Parameters:
streams - List of media locations to be played.

addDataReceiver

void addDataReceiver(UserParticipant name)
Use this method to add data receivers to the MSRPPlayer before invoke it's start(...) method.
Parameters:
name - instance of UserParticipant.

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.