org.glassfish.cafe.api
Interface MSRPPlayer

All Superinterfaces:
MediaParticipant, Participant, Player

public interface MSRPPlayer
extends Player

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

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) {

         ... <Create MSRPConference and add the required participants>....

         // After adding all the parties, send the file by adding MSRPPlayer
         MSRPPlayer player = sess.createParticipant(MSRPPlayer.class, "player");
         msrpConf.addParticipant(player);
         player.play(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>
 

Author:
bhavanishankar@dev.java.net

Method Summary
 void play(InputStream mediaStream, String contentType, long contentLength)
          Send the contents of the stream to the participants using MSRP protocol.
 void play(String... streams)
          Start sending the media from the specified location(s) using the MSRP protocol.
 void play(URI... streams)
          Start sending the media from the specified location(s) using MSRP protocol.
 
Methods inherited from interface org.glassfish.cafe.api.Player
getStreams, start, start, stop
 
Methods inherited from interface org.glassfish.cafe.api.Participant
addAgent, getAgent, getAgents, getJoinable, getName, getNickName, removeAgent, setName, setNickName
 

Method Detail

play

void play(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.

play

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

Parameters:
streams - List of media locations to be played.

play

void play(String... streams)
Start sending the media from the specified location(s) using the MSRP protocol. This is equivalent to calling play(URI.create(stream));

Parameters:
streams - List of media locations to be played.


Copyright © 2010. All Rights Reserved.