Symfony return 控制器中的视频

Symfony return video in controller

我想做一些关于用户和视频权限的过滤器,我做了一条路线:

app_filter_f:
    path: /products/{idProduct}/movies/{name}.mp4
    defaults: { _controller: AppBundle:App:filterRequest }

和一个与https://creativcoders.wordpress.com/2014/05/12/symfony2-how-to-send-video-response-to-twig-view/ with filesystem https://github.com/KnpLabs/KnpGaufretteBundle

类似动作的控制器
return new \Symfony\Component\HttpFoundation\Response($fs->read('14/movies/session1_ch1.mp4'),200,[
                'Content-Type' => 'video/mp4',
                'Connection' => 'close',
                'Content-Length' => $fs->size('14/movies/session1_ch1.mp4')
            ]);

问题是我的视频加载到页面中了,但我无法进入下一分钟,只能返回,但不能前进。

在前端我使用 html5:

<video id="course-video" width="100%" controls>
    <source src="{{ course.modules.first.movies.isEmpty() ? '' :course.modules.first.movies.first().downloadPath }}" type="video/mp4">
    Your browser does not support HTML5 video.
</video>

我试图找到任何解决方案,但我没有找到,是否可以用 symfony 模拟返回的视频,并努力改变前后分钟?

// use Symfony\Component\HttpFoundation\BinaryFileResponse

$response = new BinaryFileResponse($webPath);
$response->setAutoEtag(true);
$response->headers->set('Content-Type', 'video/mp4');
return $response;