Html / Php how to change the content of the page according to the inserted end

0

I have an HTML here that I use to generate Players in My Site

But I have to keep changing the contents of the file to access Different Videos

I would like to know if there is a way to change the area:

De acordo com a url inserida Exemplo

www.site.com.br/Player.html?video=video.mp4;img=img.png

Teria que mudar o Arquivo para Php?
Por Favor me Ajude não tenho experiencia com Programação WEB

HTML:

<video id="my_video_1" class="video-js vjs-default-skin" width="640px" height="267px"
      controls preload="none" poster='https://image.tmdb.org/t/p/w780/fVcZErSWa7gyENuj8IWp8eAfCnL.jpg'
      data-setup='{ "aspectRatio":"640:267", "playbackRates": [1, 1.5, 2] }'>
    <source src="" type='video/mp4' />

  </video>
    
asked by anonymous 22.05.2017 / 19:56

1 answer

1

You can only use the $ _GET variables of the address. Following your example (I fixed the separator from ; to & :

www.site.com.br/Player.php?video=video.mp4&img=img.png

You have two attributes, "video" and "img", and their values. So PHP looks pretty simple:

<video id="my_video_1" class="video-js vjs-default-skin" width="640px" height="267px"
  controls preload="none" poster='<?= $_GET['img'] ?>'
  data-setup='{ "aspectRatio":"640:267", "playbackRates": [1, 1.5, 2] }'>
<source src="<?= $_GET['video'] ?>" type='video/mp4' />

The result would be:

<video id="my_video_1" class="video-js vjs-default-skin" width="640px" height="267px"
  controls preload="none" poster='img.png'
  data-setup='{ "aspectRatio":"640:267", "playbackRates": [1, 1.5, 2] }'>
<source src="video.mp4" type='video/mp4' />

You can then improve the code to not show the video if, for example, it has no arguments, but then you'd better sit down and learn to program anyway.

    
22.05.2017 / 21:09