Skip to content

Commit

Permalink
Youtube embed options and button tooltips.
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Nov 9, 2012
1 parent 6a7f0fa commit 8f61519
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions hgtv/models/video.py
Expand Up @@ -103,9 +103,9 @@ def url_for(self, action='view', channel=None, playlist=None, _external=False):
def embed_video_for(self, action='view'):
if self.video_source == u'youtube':
if action == 'edit':
return Markup('<iframe src="http://www.youtube.com/embed/%s?wmode=transparent&autoplay=0" frameborder="0" allowfullscreen></iframe>' % self.video_sourceid)
return Markup('<iframe src="http://www.youtube.com/embed/%s?wmode=transparent&showinfo=0&rel=0&autohide=1&autoplay=0" frameborder="0" allowfullscreen></iframe>' % self.video_sourceid)
elif action == 'view':
return Markup('<iframe src="http://www.youtube.com/embed/%s?wmode=transparent&autoplay=1" frameborder="0" allowfullscreen></iframe>' % self.video_sourceid)
return Markup('<iframe src="http://www.youtube.com/embed/%s?wmode=transparent&showinfo=0&rel=0&autohide=1&autoplay=1" frameborder="0" allowfullscreen></iframe>' % self.video_sourceid)
return u''

def embed_slides_for(self, action=None):
Expand Down
10 changes: 6 additions & 4 deletions hgtv/templates/video.html
Expand Up @@ -20,9 +20,9 @@ <h1>{{ video.title }}</h1>
{{ form.csrf_token() }}
<div class="btn-toolbar pull-left">
<div class="btn-group" data-toggle="buttons-checkbox">
<button class="btn {%- if flags['starred'] %} active{% endif %}" title="Star" name="action" value="star"> <i class="icon-star"></i>
<button class="btn {%- if flags['starred'] %} active{% endif %}" title="Add to favourites" name="action" value="star"> <i class="icon-star"></i>
</button>
<button class="btn {%- if flags['queued'] %} active{% endif %}" title="Add to Queue" name="action" value="queue"> <i class="icon-time"></i>
<button class="btn {%- if flags['queued'] %} active{% endif %}" title="Watch this later" name="action" value="queue"> <i class="icon-time"></i>
</button>
</div>
<div class="btn-group" data-toggle="buttons-radio">
Expand Down Expand Up @@ -69,7 +69,7 @@ <h1>{{ video.title }}</h1>
{% block content %}
<div class="row">
<div class="span6">
<div class="video169 {{ video.video_source }}">{{ video.embed_video_for(config.get('VIDEO_VIEW_MODE', 'view')) }}</div>
<div class="video169">{{ video.embed_video_for(config.get('VIDEO_VIEW_MODE', 'view')) }}</div>
{{ videoactions() }}
{% set next_video, prev_video = playlist.next(video=video), playlist.prev(video=video) %}
{% if prev_video -%}
Expand Down Expand Up @@ -97,7 +97,7 @@ <h3>Speakers</h3>
<label for="sync-slides">Sync slides with video</label>
</div>
{%- else -%}
<div class="video169 {{ video.video_source }}"><div class="placeholder"><div><span>No slides available</span></div></div></div>
<div class="video169"><div class="placeholder"><div><span>No slides available</span></div></div></div>
{%- endif %}
{% endwith %}
</div>
Expand All @@ -113,6 +113,8 @@ <h3>Speakers</h3>
{% if g.user %}
<script type="text/javascript">
$(function() {
$(".btn-toolbar button, .btn-toolbar a").tooltip({placement: 'bottom'});

var playlist_action = function(url, data, type) {
$.ajax({
type: type,
Expand Down

0 comments on commit 8f61519

Please sign in to comment.