Help with simple web routine

Discussion in 'Webmastering & Programming' started by WilliamJones, Apr 12, 2019.

  1. WilliamJones

    WilliamJones n00b

    Messages:
    27
    Joined:
    Aug 19, 2018
    I am not a programmer, but need help with a website routine. I have a server that will have a video file (MP4) that has a link on the website. When a user clicks the link, the video plays. If the video is missing, the link will show a JPG file instead. That is, the server will have 2 files, a JPG and an MP4. The user clicks on the link which goes to the MP4 on the server. If the MP4 is deleted, the user sees the JPG.
    Any help would be appreciated.
     
  2. modi123

    modi123 [H]ardness Supreme

    Messages:
    5,053
    Joined:
    Sep 6, 2006
    What have you tried or looked into?

    I would imagine you could create some javascript to check for the file.. there then do what ever.. if not swap out the control with a link to the image.
     
  3. WilliamJones

    WilliamJones n00b

    Messages:
    27
    Joined:
    Aug 19, 2018
    Since I am not a programmer and don't know javascript, I was hoping to get something a bit more specific. I have taken HTML code before and made it work, but didn't know where to start.
     
  4. Brian_B

    Brian_B 2[H]4U

    Messages:
    2,353
    Joined:
    Mar 23, 2012
    My first question would be - if your running the server why would the MP4 get mysteriously deleted?

    If you delete the file, not being program saavy could you also just swap/edit the html file over to point to the jpg by hand?
     
  5. modi123

    modi123 [H]ardness Supreme

    Messages:
    5,053
    Joined:
    Sep 6, 2006