• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Link to video

Participant ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

On a website I have a link to a movie to be played.
When the movie is over, I want to return to the previous page
Tips are desired.

Views

158

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

Hello, Hjalmar_Molin,

 

A suggestion, if I may.  What you are asking would require the user's computer to detect when the video is done playing, which JavaScript might be able to do.  I am unsure.

 

However, what I would do is display the video in a modal, with an 'X' in the upper right corner for the user to close the modal when the video is done playing.  Just my two cents.

 

HTH,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

Look up javascript 'onended'

 

Give your video an id like id="myVideo" then get a handle to the video and then execute a function to go to a page once the video has ended:

 

<script>

const myVideo = document.querySelector('#myVideo');

myVideo.onended = function() {

window.location.href = 'https://www.yourpagename.com';

}

</script>

 

Not at computer right now so cant test but l think that might work.

Although l agree with others, a return link to the previous page or modal overlay would be a better solution. Its a little bit rude to be whisked off to another location when you are not expecting it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

A javascript redirect will do it, using the "onended" media event, but you have to then play the video in its own page, not just a link to a mp4 file: https://www.w3schools.com/tags/ref_eventattributes.asp 

Most people despise automatic rediects though, so using Wolfshade's method of displaying the video within a modal window on the original page, is a much better option.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

LATEST

In addition to what has been offered with the modal and javascript options, I have recommended in a few cases to look into the Wistia player for client's videos.  They offer a unique array of integrations to allow you to embed calls to action or forms within your videos. Or you can integrate with marketing solutions or helpdesk offerings so your visitors get what they need and there's no programming involved.

 

https://wistia.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines