Giter VIP home page Giter VIP logo

spree_videos's Introduction

Spree Videos

Display YouTube video(s) on your product page.

  • Thumbnails from YouTube
  • Clickable thumbnails to easily switch between videos
  • Easily add/remove/edit videos through the spree admin
  • No markup will be added to your products if a video is not attached
  • Polymorphic watchable association on Spree::Video model โ€“ enables you to attach videos to any model in your app
  • Versions available for Spree 0.7 & 1.x

Example

There is no deface override included by default to include the videos in your product page. To add videos to your product page:

# products/show.html.erb
<%= render 'video', :product => @product %>

If you are using Twitter Bootstrap, you can easily add title tooltips to your video thumbnails:"

# javascripts/store/your.coffeescript
$('#video-thumbnails > a').tooltip()

Installation

bundle exec rails g spree_videos:install

# auto run via the install generator, but in case you didn't run it
bundle exec rake db:migrate

Configuration

JS + HTML YouTube Parameters

You can specify configuration options that get passed through to the JS dynamic youtube video switcher & the html5 embed. Take a look at config/initializers/spree_videos.rb for example configuration.

Deface Override

By default spree_videos inserts the videos into #product_properties in products/show. Disable the override to remove this behavior.

CSS

You can easily customize the display of the thumbnails / player:

// stylesheets/store/videos.css.less

#product-videos {

	#video-player {
		// player holder
	}

	#video-thumbnails {
		// thumbnail holder

		a {
			// thumbnails 

			display: block;
			float: left;

			&:hover { }
			
			&:first-child { }
			
			&:last-child { }
		}
	}
}

Contributors

  • Mark Linn, @markalinn
  • Michael Bianco, @iloveitaly
  • Aleksey, @alekseydem

spree_videos's People

Contributors

ademidov avatar bryanmtl avatar iloveitaly avatar markalinn avatar nicedawg avatar

Watchers

 avatar  avatar

Forkers

tagipedia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.