Skip to content

Commit

Permalink
add lil scrub to playlist view
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeese committed Dec 16, 2016
1 parent d375c22 commit 2642838
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/assets/javascripts/avalon_player.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ class AvalonPlayer
.addClass('current-stream')
.trigger('streamswitch', [@stream_info])
if @player? && @player.options.trackScrubberEnabled
trackstart = parseFloat($(active_node).data('fragmentbegin')||0)||0
trackend = parseFloat($(active_node).data('fragmentend')||@stream_info.duration)||@stream_info.duration
if active_node==null
trackstart = @stream_info.t[0]
trackend = @stream_info.t[1] || @stream_info.duration
else
trackstart = parseFloat($(active_node).data('fragmentbegin')||0)||0
trackend = parseFloat($(active_node).data('fragmentend')||@stream_info.duration)||@stream_info.duration
@player.initializeTrackScrubber(trackstart, trackend, @stream_info)

marked_node = @container.find('i.now-playing')
Expand Down
3 changes: 3 additions & 0 deletions app/views/playlists/_player.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ Unless required by applicable law or agreed to in writing, software distributed
<%= javascript_include_tag 'mediaelement-skin-avalon/mep-feature-responsive' %>
<%= javascript_include_tag 'avalon_player' %>
<%= javascript_include_tag 'me-add-to-playlist' %>
<%= javascript_include_tag 'me-track-scrubber' %>
<%= stylesheet_link_tag "mediaelement-qualityselector/mep-feature-qualities" =%>
<%= stylesheet_link_tag 'me-thumb-selector' %>
<%= stylesheet_link_tag "mediaelement-skin-avalon/mejs-skin-avalon" =%>
<%= stylesheet_link_tag 'me-add-to-playlist' %>
<%= stylesheet_link_tag 'me-track-scrubber' %>
<% if @currentStream.present? and @currentStream.derivatives.present? %>
<script>
Expand All @@ -92,6 +94,7 @@ Unless required by applicable law or agreed to in writing, software distributed
customError: '<%= t("media_objects.player.customError").html_safe %>',
displayMediaFragment: true,
displayMarkers: true,
displayTrackScrubber: true,
autostart: <%= params[:autostart] == 'true' ? 'true' : 'false' %>,
success: function(mediaElement, domObject, player) {
player.media.addEventListener('timeupdate', function(e) {
Expand Down
1 change: 1 addition & 0 deletions app/views/playlists/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Unless required by applicable law or agreed to in writing, software distributed
<% @current_mediaobject = MediaObject.find(@current_masterfile.mediaobject_id) %>
<div class="col-sm-8" id="left_column">
<%= render 'player' %>
<%= render file: '_track_scrubber.html.erb' %>
<%= render file: '_add_to_playlist.html.erb' if current_user.present? %>
<%= render 'info' %>
</div>
Expand Down

0 comments on commit 2642838

Please sign in to comment.