popcorn-team/popcorn-app — pull request #625 by d-oliveros (2014-03-24 09:04:53+00:00)
Title: "View trailer" feature

Hey guys. I've built a Trailer provider and a "View trailer" button.

I tried using traileraddict's API first, but they don't provide relevant trailers if searching by film, they just give you the most recent trailer uploads, which are usually bull. ( http://www.traileraddict.com/trailerapi )

So, I'm querying youtube for the relevant trailers, and sanitizing the results (By weeding out results that do not contain "trailer" in the title). I've tested it with about 80 movies and the trailers are always being fetched correctly.

The "View trailer" button has a lower opacity when the trailer hasn't been fetched, and go on full opacity when the trailer is fetched.

As for the player, I'm reusing the same player as the torrents player. That's to maintain consistency between styles, and to reuse the components as much as we can. I'm using VideoJS + this: https://github.com/eXon/videojs-youtube. The source has been added to the "videojsplugins.js" file we currently have.

I'm not a good designer, so if someone wants to check and change the visual display / layout of the button, I'd be grateful.

I've attached a couple of screenshots:
![screenshot from 2014-03-24 01 50 43](https://f.cloud.github.com/assets/2173299/2497174/e6a0852e-b331-11e3-84e0-f76e52fa4ad1.png)

![screenshot from 2014-03-24 01 52 46](https://f.cloud.github.com/assets/2173299/2497177/05676b94-b332-11e3-824a-9cf6cad17a49.png)