Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4933

Video using RepeatableInputStream loads very long, Byte[] is instant

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.0
    • 9.5.1.3, 9.6.0
    • General
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      Run a Video component with both code snippets below:

       

      		File file = new File("path\\test3.mp4");
      		Reader reader = RepeatableReader.getInstance(file);
      		InputStream fileInputStream = new FileInputStream(file);
      		AVideo content = new AVideo("test3.mp4", RepeatableInputStream.getInstance(fileInputStream));
      		Video videoViewer = new Video();
      		videoViewer.setHflex("1");
      		videoViewer.setVflex("1");
      		videoViewer.setControls(true);
      		videoViewer.setContent(content);
      		videoViewer.setParent(comp);
      		videoViewer.play();
      
      		File file2 = new File("path\\test3.mp4");
      		InputStream fileInputStream2 = new FileInputStream(file2);
      		byte[] byteArray = IOUtils.toByteArray(fileInputStream2);
      		AVideo content2 = new AVideo("test3.mp4", byteArray);
      		Video videoViewer2 = new Video();
      		videoViewer2.setHflex("1");
      		videoViewer2.setVflex("1");
      		videoViewer2.setControls(true);
      		videoViewer2.setContent(content2);
      		videoViewer2.setParent(comp);
      		videoViewer2.play();
      

      Current Result

      The video component created with a Byte[] content starts to stream immediately

      The video component created with a RepeatableInputStream takes multiple minutes to load before starting to play

      Expected Result

       RepeatableInputStream should have a reasonable loading time

      Debug Information

       

      Workaround

      1. Use Byte[] to load content
      2. Use RepeatableInputStream.getInstance(File)
      3. Use RepeatableInputStream.getInstance(new BufferedInputStream(InputStream))

            rudyhuang rudyhuang
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 4 hours Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - 4 hours Remaining Estimate - 4 hours
                4h