HOW CAN I MAKE CONTENT AVAILABLE ONCE AUDIO OR VIDEO HAS ENEDED

I am trying to figure out away where once an audio or video has ended it triggers content to become available(unlocks content) to the user.

Is this possible with javascript and if so where would I start?