Package org.fourthline.cling.support.model

Examples of org.fourthline.cling.support.model.TransportInfo


    // Build media info
    String duration = ModelUtil.toTimeString(player.getDuration());
    mediaInfo = new MediaInfo(currentURI, currentURIMetaData, null, duration, null);
    positionInfo = new PositionInfo(1, currentURIMetaData, currentURI);
      transportInfo = new TransportInfo(TransportState.STOPPED);   
   
        getLastChange().setEventedValue(
                getDefaultInstanceID(),
                new AVTransportVariable.TransportState(TransportState.STOPPED),
                new AVTransportVariable.CurrentTransportActions(new TransportAction[]{
View Full Code Here


    @Override
    public void stop(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
      if (player != null) {
        try {
      player.stop();
      transportInfo = new TransportInfo(TransportState.STOPPED);
      this.getLastChange().setEventedValue(
        this.getCurrentInstanceIds()[0],
        new AVTransportVariable.TransportState(TransportState.STOPPED)
      );
      this.getLastChange().fire(getPropertyChangeSupport());
View Full Code Here

    @Override
    public void play(UnsignedIntegerFourBytes instanceId, String speed) throws AVTransportException {
       if (player != null) {
         try {
           player.play();
           transportInfo = new TransportInfo(TransportState.PLAYING);
 
             getLastChange().setEventedValue(
                     getDefaultInstanceID(),
                     new AVTransportVariable.TransportState(TransportState.PLAYING),
                     new AVTransportVariable.CurrentTransportActions(new TransportAction[]{
                             TransportAction.Stop
                     })
             );
             getLastChange().fire(getPropertyChangeSupport());
         } catch (PlayerException e) {
           throw new AVTransportException(ErrorCode.ACTION_FAILED, e.toString());
         }
       } else {
         transportInfo = new TransportInfo(TransportState.STOPPED);
         throw new AVTransportException(ErrorCode.INVALID_ACTION, "No player created - try setting URI of media first.");
       }
      
    }
View Full Code Here

    @Override
    public void pause(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
      if (player != null) {
          try {
            player.pause();
            transportInfo = new TransportInfo(TransportState.PAUSED_PLAYBACK);
  
              getLastChange().setEventedValue(
                      getDefaultInstanceID(),
                      new AVTransportVariable.TransportState(TransportState.PAUSED_PLAYBACK),
                      new AVTransportVariable.CurrentTransportActions(new TransportAction[]{
                              TransportAction.Stop,
                              TransportAction.Play
                      })
              );
              getLastChange().fire(getPropertyChangeSupport());
          } catch (PlayerException e) {
            throw new AVTransportException(ErrorCode.ACTION_FAILED, e.toString());
          }
        } else {
          transportInfo = new TransportInfo(TransportState.STOPPED);
          throw new AVTransportException(ErrorCode.INVALID_ACTION, "No player created - try setting URI of media first.");
        }
       
    }
View Full Code Here

TOP

Related Classes of org.fourthline.cling.support.model.TransportInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.