Skip to content

Commit

Permalink
add video player fix #18
Browse files Browse the repository at this point in the history
  • Loading branch information
happypeter committed Nov 22, 2012
1 parent 1d8bdfa commit b5eb49c
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 15 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@import "vendor/bootstrap";
@import "global";
@import "comment";
@import "course";

$main_width: 960px;

Expand Down
19 changes: 19 additions & 0 deletions app/assets/stylesheets/course.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
div#html5-player {
border: 1px solid $light-gray;
width: 768px;
margin: 0 auto;
video#videojs {
display: block;
}
#title_area {
padding: 10px;
border: 3px solid $light-blue;
h2 {
margin-bottom: -10px;
}
p.light {
font-size: 90%;
color: $light-green;
}
}
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/global.css.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$light-gray: #ececec;
$light-green: #75AE07;
$light-blue: #7ac9de;
@mixin onestep-shadow {
-webkit-box-shadow: 0 0 6px $light-gray;
-moz-box-shadow: 0 0 6px $light-gray;
Expand Down
16 changes: 16 additions & 0 deletions app/views/courses/_video_player.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div id="html5-player">
<video id="videojs" class="video-js vjs-default-skin" controls width="768" height="576" poster="" preload="auto" data-setup="{}">
<source src="http://media.happycasts.net/assets/episodes/videos/041-tmux.mov" type="video/mp4"/ >
</video>
<div id="title_area">
<h2><%= course.name %></h2>
<p class="light"><%=course.cat.titleize %><p>
<p><%=course.description %><p>
<p>
<% if can? :edit, :course %>
<%= link_to 'Edit', edit_course_path(@course) %>
<% end %>
</p>
</div>
</div>

18 changes: 3 additions & 15 deletions app/views/courses/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
<p id="notice"><%= notice %></p>
<script src="http://vjs.zencdn.net/c/video.js"></script>

<p>
<b><%= t('course_name') %>:</b>
<%= @course.name %>
<br>
<b><%= t('cat') %>:</b>
<%= @course.cat %>
<br>
<b><%= t('description') %>:</b>
<%= @course.description %>
</p>

<% if can? :edit, :course %>
<%= link_to 'Edit', edit_course_path(@course) %>
<% end %>

<%= render "video_player", :course => @course %>

<div id="comments">
<h3><%= t("comment") %></h3>
Expand All @@ -37,3 +24,4 @@
</div>
<br \>
<% end %>

1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<title>Onestep</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
<%= csrf_meta_tags %>
</head>
<body>
Expand Down

0 comments on commit b5eb49c

Please sign in to comment.