Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
musica_listas_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
musica_listas_backend
Commits
fc6c9b6c
Commit
fc6c9b6c
authored
Aug 19, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prueba command conversion 3
parent
5cdff7d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
27 deletions
+3
-27
src/BackendBundle/Controller/TestController.php
src/BackendBundle/Controller/TestController.php
+3
-27
No files found.
src/BackendBundle/Controller/TestController.php
View file @
fc6c9b6c
...
...
@@ -13,33 +13,9 @@ class TestController extends AbstractController {
public
function
video
(
Request
$request
)
:
Response
{
$this
->
manager
=
$this
->
getDoctrine
()
->
getManager
(
'default'
);
return
$this
->
render
(
'test/index.html.twig'
);
}
public
function
getVideo
(
Request
$request
)
:
Response
{
$id
=
$request
->
get
(
"id"
,
null
);
//se busca archivo en base al id en la base de datos
//se obtiene la url de este (ubicacion en el disco)
// Generate response
$response
=
new
Response
();
$filename
=
Utiles
::
getPublicRoot
()
.
"/videos/0/video.m3u8"
;
// Set headers
$response
->
headers
->
set
(
'Cache-Control'
,
'private'
);
$response
->
headers
->
set
(
'Content-type'
,
mime_content_type
(
$filename
));
$response
->
headers
->
set
(
'Content-Disposition'
,
'attachment; filename="'
.
basename
(
$filename
)
.
'";'
);
$response
->
headers
->
set
(
'Content-length'
,
filesize
(
$filename
));
// Send headers before outputting anything
$response
->
sendHeaders
();
$response
->
setContent
(
file_get_contents
(
$filename
));
return
$response
;
//se obtiene la url del video con el archivo m3u8 y se le pasa codificada hacia el front en base 64
$url
=
base64_encode
(
"http://newbackendcontenidos.gearlabs.cl/videos/0/video.m3u8"
);
return
$this
->
render
(
'test/index.html.twig'
,
array
(
"url"
=>
$url
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment