CodeIgniter Forums
How to stream response output? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: How to stream response output? (/showthread.php?tid=72879)

Pages: 1 2


How to stream response output? - HardyW - 02-23-2019

Hi,

is there any possibility to stream response output?

I would like to stream a video to the browser. But because the video's size is to large I cannot do something like

PHP Code:
$response->setBody($video); 
Currently I am using the following construct that I would like to replace:

PHP Code:
while (...)
{
 
 $data fread($handle,$bytesToRead);
  echo 
$data;
  
flush();
  
$bytesToRead = ...;




RE: How to stream response output? - InsiteFX - 02-24-2019

Maybe this will help you out.

PHP HTML5 Video Streaming Tutorial


RE: How to stream response output? - HardyW - 02-24-2019

(02-24-2019, 09:33 AM)InsiteFX Wrote: Maybe this will help you out.

PHP HTML5 Video Streaming Tutorial

Hi,

yes, I know that implementation but I am looking for a solution using CI4.


RE: How to stream response output? - InsiteFX - 02-25-2019

Any php solution should work with CI 4 it's just a framework.

Video is specific to html so by using a php framework you need
to roll your own or find a solution.


RE: How to stream response output? - HardyW - 02-25-2019

(02-25-2019, 04:27 AM)InsiteFX Wrote: Any php solution should work with CI 4 it's just a framework.

Video is specific to html so by using a php framework you need
to roll your own or find a solution.

Hi,

video is just an example. In general I was looking for a streaming / chunked up- and download solution using the CodeIgniter framework.


RE: How to stream response output? - kenjis - 07-15-2022

It seems you need to extend the Response class to support stream output.


RE: How to stream response output? - InsiteFX - 07-16-2022

I know Lonnie and I wrote a video help a while back maybe streaming could be added to that helper.


RE: How to stream response output? - kenjis - 07-16-2022

What's a video help?


RE: How to stream response output? - ignitedcms - 07-16-2022

(02-25-2019, 01:42 PM)HardyW Wrote:
(02-25-2019, 04:27 AM)InsiteFX Wrote: Any php solution should work with CI 4 it's just a framework.

Video is specific to html so by using a php framework you need
to roll your own or find a solution.

Hi,

video is just an example. In general I was looking for a streaming / chunked up- and download solution using the CodeIgniter framework.

Not necessarily related to streaming but instead uploading large files, chunking should be fairly trivial to implement. We have simple chunked uploading class, basically just borrowing some of the core from pluploader

https://www.ignitedcms.com/playground/chunked


RE: How to stream response output? - InsiteFX - 07-16-2022

@kenjis Its the html 5 video help for the html code. It's in the html_helper along with audio.