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
0cc0cc8e
Commit
0cc0cc8e
authored
Aug 15, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actualizacion prueba video
parent
07e80ab2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
2 deletions
+64
-2
config/routes.yaml
config/routes.yaml
+15
-1
src/BackendBundle/Controller/TestController.php
src/BackendBundle/Controller/TestController.php
+45
-0
src/Utilities/Utiles.php
src/Utilities/Utiles.php
+1
-1
templates/test/index.html.twig
templates/test/index.html.twig
+3
-0
No files found.
config/routes.yaml
View file @
0cc0cc8e
...
...
@@ -124,4 +124,18 @@ ws_notificacion_suscripcion_desinscripcion:
ws_notificacion_cobro
:
path
:
app/ws/notificacion/cobro
controller
:
App\WsBundle\Controller\wsReceptorVPW::notificacionesCobro
methods
:
[
GET
,
POST
]
\ No newline at end of file
methods
:
[
GET
,
POST
]
test_video
:
path
:
app/video
controller
:
App\BackendBundle\Controller\Test::video
methods
:
[
GET
]
get_video
:
path
:
app/get/media/{key}
controller
:
App\BackendBundle\Controller\Test::getVideo
requirements
:
key
:
\d+
\ No newline at end of file
src/BackendBundle/Controller/TestController.php
0 → 100644
View file @
0cc0cc8e
<?php
namespace
App\BackendBundle\Controller
;
use
Symfony\Bundle\FrameworkBundle\Controller\AbstractController
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\Request
;
use
App\Utilities\Utiles
;
class
TestController
extends
AbstractController
{
private
$manager
=
null
;
public
function
video
(
Request
$request
)
:
Response
{
$this
->
manager
=
$this
->
getDoctrine
()
->
getManager
(
'default'
);
return
$this
->
render
(
'test/index.html.twig'
,
array
());
}
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
;
}
}
src/Utilities/Utiles.php
View file @
0cc0cc8e
...
...
@@ -29,7 +29,7 @@ class Utiles {
$log
->
pushHandler
(
$handler
);
return
$log
;
}
public
static
function
isMsisdn
(
$msisdn
)
{
if
(
strlen
(
$msisdn
)
!=
9
||
!
is_numeric
(
$msisdn
))
{
return
false
;
...
...
templates/test/index.html.twig
0 → 100644
View file @
0cc0cc8e
<video
width=
"352"
height=
"198"
controls
>
<source
src=
"
{{
path
(
''
,
{
'media'
:
'0908978'
}
)
}}
"
type=
"application/x-mpegURL"
>
</video>
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