Adding a simple Video player

Hi Guys,

I’m having a problem with javascript again (really must learn more about this). What I’m trying to do is create a simple, video player that can load videos on demand from a playlist. The screen would look something like this:

The container on the right is a simple HTML5 box that i’ve designated as the videoarea.

The playlist is a scrolling list of video titles. Again, it’s been created as an HTML box with code that calls up the various videos. It looks like this:

I’ve also got a piece of javascript that is supposed to control the whole thing. It’s shown below:

I suspect that it’s the syntax in this javascript that messing things up.

Finally, I’ve got a small CSS file which has been added to the project head. It looks like this:

Can anyone give me a clue as to what I may be doing wrong here?

All help and assistance will be greatly appreciated.

Have you searched the site… there are a load of examples of dynamic video load…

It’d be useful if you could post a zip of your .hype document; it is hard to debug code or see how things are structured from just screenshots. Thanks!

1 Like

As Jonathan said having a doc would help to see what problems are. From your one screenshot I can see the code is setting the src attribute twice … for whatever reason. Check if there are any console errors which may help point in the direction of the problem.

The only other option is to share the doc.

Attached is the hype document.

The idea is fairly simple. A list of video links is presented on left of the screen and a video container is presented on the right. Clicking a link should go get the video and play it in the container. For some reason it doesn’t seem to want to work.

I’ve also noticed something with video generally in Hype. Unless the video is actually hosted on a streaming server, (youtube, Vimeo etc.) it doesn’t like playing the videos. They play ok in Hype but once exported and uploaded, they don’t like playing. Is this something to do with not using the video tag within hype?

Anyway, any ideas on this would be great.

videoPlaylist.hype.zip (10.6 KB)

OK. You've used jQuery code in your document but don't actually have a link to the jQuery Library code. Once you include this then the doc works fine.

You need to get a hold of the jQuery library and include it in your Head.

Nope. The video (if set up correctly) should play fine. This is simply HTML5 video.

2 Likes

That was a bad oversight on my part - I didn’t include jQuery in the hype project because the final product is intended to be embedded in a website that does include jQuery. Anyway, added it as suggested, but still nothing!

It played fine for me (as with @DBear ) with the link to the jQuery Library code added, with one exception: “Resident Evil”.
When I loaded the link directly in my web browser’s address bar it came up empty also.

Also to note:
You are using the WebM format only for “Resident Evil” & “Big Buck Bunny” - this format is unsupported by Safari, and You do not offer a Safari playable format (".mp4") as an alternative~fallback. Please click here for more details about “WebM”.


Side Note: Here is the CDN link to the jQuery library I used:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

3 Likes

That did the trick. I was using a local hosted version of jQuery that just didn’t seem to work. Anyway, all is well now and everything is working fine. Many thanks for you help.

1 Like