Package org.red5.server.api.stream.support

Examples of org.red5.server.api.stream.support.SimplePlayItem


  }

  @Test
  public void testAddItemIPlayItem() {
    System.out.println("testAddItemIPlayItem");
    SimplePlayItem item = SimplePlayItem.build("h264_speex.flv");
    pss.addItem(item);
  }
View Full Code Here


    serverStream.removeAllItems();
  }

  @Test
  public void testAddItemIPlayItem() {
    SimplePlayItem item = SimplePlayItem.build("f1");
    serverStream.addItem(item);
    assertTrue(serverStream.getCurrentItemIndex() == 0);
    SimplePlayItem item2 = SimplePlayItem.build("f2");
    serverStream.addItem(item2);
    assertTrue(serverStream.getCurrentItemIndex() == 0);
    assertTrue(serverStream.getItemSize() == 2);
  }
View Full Code Here

    assertTrue(serverStream.getItemSize() == 2);
  }

  @Test
  public void testAddItemIPlayItemInt() {
    SimplePlayItem item = SimplePlayItem.build("f1");
    serverStream.addItem(item);
    SimplePlayItem item2 = SimplePlayItem.build("f2");
    serverStream.addItem(item2);
    SimplePlayItem item3 = SimplePlayItem.build("f3");
    serverStream.addItem(item3, 0);
    System.out.println("Items: " + ((ServerStream) serverStream).getItems());
    assertTrue(serverStream.getItemSize() == 3);
    assertTrue("f1".equals(serverStream.getItem(1).getName()));
  }
View Full Code Here

    assertTrue("f1".equals(serverStream.getItem(1).getName()));
  }

  @Test
  public void zzremoveItem() {
    SimplePlayItem item = SimplePlayItem.build("f1");
    serverStream.addItem(item);
    SimplePlayItem item2 = SimplePlayItem.build("f2");
    serverStream.addItem(item2);
    assertTrue(serverStream.getItemSize() == 2);
    serverStream.removeItem(0);
    assertTrue(serverStream.getItemSize() == 1);
  }
View Full Code Here

    assertTrue(serverStream.getItemSize() == 1);
  }

  @Test
  public void zzzremoveAllItems() {
    SimplePlayItem item = SimplePlayItem.build("f1");
    serverStream.addItem(item);
    assertTrue(serverStream.getItemSize() == 1);
    serverStream.removeAllItems();
    assertTrue(serverStream.getItemSize() == 0);
    assertTrue(serverStream.getCurrentItemIndex() == 0);
View Full Code Here

    assertTrue(serverStream.getCurrentItemIndex() == 0);
  }

  @Test
  public void testGetCurrentItem() {
    SimplePlayItem item = SimplePlayItem.build("f1");
    serverStream.addItem(item);
    serverStream.start();
    assertEquals(item, serverStream.getCurrentItem());
  }
View Full Code Here

    assertEquals(item, serverStream.getCurrentItem());
  }

  @Test
  public void testGetItem() {
    SimplePlayItem item = SimplePlayItem.build("f1");
    serverStream.addItem(item);
    assertTrue("f1".equals(serverStream.getItem(0).getName()));
  }
View Full Code Here

    assertTrue("f1".equals(serverStream.getItem(0).getName()));
  }

  @Test
  public void testNextItem() {
    SimplePlayItem item = SimplePlayItem.build("h264_aac");
    serverStream.addItem(item);
    SimplePlayItem item2 = SimplePlayItem.build("h264_speex");
    serverStream.addItem(item2);
    //serverStream.start();
    System.out.printf("Play items: #1 %s #2 %s\n", serverStream.getItem(0).getName(), serverStream.getItem(1).getName());
    serverStream.nextItem();
    System.out.printf("Play items: #1 %s #2 %s\n", serverStream.getItem(0).getName(), serverStream.getItem(1).getName());
View Full Code Here

    }
    if (!(stream instanceof ISubscriberStream)) {
      return;
    }
    ISubscriberStream subscriberStream = (ISubscriberStream) stream;
    SimplePlayItem item = new SimplePlayItem();
    item.setName(name);
    item.setStart(start);
    item.setLength(length);
    if (subscriberStream instanceof IPlaylistSubscriberStream) {
      IPlaylistSubscriberStream playlistStream = (IPlaylistSubscriberStream) subscriberStream;
      if (flushPlaylist) {
        playlistStream.removeAllItems();
      }
View Full Code Here

            if ( !( event instanceof IRTMPEvent ) ) {
                logger.debug( "skipping non rtmp event: " + event );
                return;
            }

            IRTMPEvent rtmpEvent = (IRTMPEvent) event;

            if ( logger.isDebugEnabled() ) {
                // logger.debug("rtmp event: " + rtmpEvent.getHeader() + ", " +
                // rtmpEvent.getClass().getSimpleName());
            }

            if ( !( rtmpEvent instanceof IStreamData ) ) {
                logger.debug( "skipping non stream data" );
                return;
            }

            if ( rtmpEvent.getHeader().getSize() == 0 ) {
                logger.debug( "skipping event where size == 0" );
                return;
            }

            if ( rtmpEvent instanceof VideoData ) {
View Full Code Here

TOP

Related Classes of org.red5.server.api.stream.support.SimplePlayItem

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.