All threads / How to build something like a Youtube advertisement system

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to build something like a Youtube advertisement system

Darren Booker asked in Rails

Hi Chris,

I am pretty sure they have a complex system implmented but at the basics of it, how could you go about implementing an autoplay advertise video before the actual video itself starts to play just like youtube? Never seen it done in a rails application. I created a clone youtube application for the fun of it and want to take it up a knotch a bit.

Is there third party service for advertisement you can implement?

You'd just need to find a video player that will do it for you (that way you don't have to build it yourself).

https://www.jwplayer.com/video-ad-support/
https://cloudinary.com/product_updates/video_player_ads

There are several other options.

If you wanted to build it yourself, you'd first play the ad, then when it is finished, replace the video with your content. All that will probably be in Javascript and you'd need videos for the ads and such to serve up. And you'd want to collect ad metrics for plays and clicks, etc probably.

Perfect.

JWPLAYER is exactly what I was looking for. Chris one more question. Rails uses the standard video_tag to actually render the video. Is there a way to count views like youtube. I know jwplayer might have the feature but if I wanted to do it from scratch, how would you go about implmenting this feature?

Thanks!

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,674+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.