Commit ef2ba1c3 authored by marcheing's avatar marcheing

Add video player feature

parent b8d0ba45
<div>
<video id="video-<%= content.id %>" class="video-js" controls preload="none" width="<%= video.instance.width %>" height="<%= video.instance.height %>" data-setup="{}">
<source src="<%= video.url %>" type="video/mp4">
<p class="vjs-no-js">
<%= t('video_js_support_message_html') %>
</p>
<%# FIXME: Poltergeist server won't recognize the video source if put on a source tag %>
<video id="video-<%= content.id %>" class="video-js" controls preload="none" width="<%= video.instance.width %>" height="<%= video.instance.height %>" data-setup="{}" src="<%= video.url %>" type="video/mp4">
<p class="vjs-no-js">
<%= t('video_js_support_message_html') %>
</p>
</video>
</div>
Given(/^there is a video author user$/) do
@video_author = create(:user)
create(:profile, user_id: @video_author.id)
end
Given(/^the video author has a stored and encoded video$/) do
@video = create(:video, :zencoder, user_id: @video_author.id)
Delayed::Job.where(queue: 'zencoder').last.invoke_job
`zencoder_fetcher -u #{ZencoderSettings.notifications.url} #{ZencoderSettings.api_key} -n 1 -x`
end
When(/^I visit the video's page$/) do
visit content_path(id: @video.id)
end
Then(/^I should see the video player$/) do
# By using div on the selector, it is forcing the page to have the videojs loaded
expect(has_css?('div.video-js')).to eq true
end
Then(/^I should be able to see the video's author$/) do
should have_content(@video_author.profile.full_name)
end
Feature: Video player
In order to see video contents
As a regular user
I should be able to see the finished video contents
Background:
Given I have a registered and confirmed user
And I am logged in
@javascript
Scenario: Accessing a finished video page
Given there is a video author user
And the video author has a stored and encoded video
When I visit the video's page
Then I should see the video player
And I should be able to see the video's author
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment