Skip to content

Commit

Permalink
Feature: Configurable video formats (#26)
Browse files Browse the repository at this point in the history
* Changed from a fixed number of video formats to depending on formats supplied.
  • Loading branch information
tuj authored Mar 22, 2020
1 parent d2ca560 commit 139ae21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<div class="only-video" data-ng-style="{'width': theStyle.width, 'height': theStyle.height}">
<div data-ng-if="ikSlide.media.length > 0 && ikSlide.media[0].provider_status === 3">Videoen er endnu ikke klar.</div>
<video data-ng-if="ikSlide.media.length > 0 && ikSlide.media[0].provider_status === 1" class="only-video--video-player" controls id="videoPlayer">
<source data-ng-src="{{ikSlide.currentVideo.webm}}" type="video/webm">
<source data-ng-src="{{ikSlide.currentVideo.ogg}}" type="video/ogg">
<source data-ng-src="{{ikSlide.currentVideo.mp4}}" type="video/mp4">
<video data-ng-if="ikSlide.media.length > 0 && ikSlide.media[0].provider_metadata[0].reference" class="only-video--video-player" controls id="videoPlayer">
<source data-ng-src="{{mediaEntry.reference}}" type="video/{{mediaEntry.format}}" data-ng-repeat="mediaEntry in ikSlide.media[0].provider_metadata">
</video>

<img class="only-video--logo" data-ng-show="ikSlide.currentLogo" data-ng-style="{'top':ikSlide.options.logopos.top, 'bottom':ikSlide.options.logopos.bottom, 'left':ikSlide.options.logopos.left, 'right':ikSlide.options.logopos.right, 'width': ikSlide.options.logosize}" data-ng-src="{{ikSlide.currentLogo}}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<div class="only-video">
<video id="videoPlayer-{{ikSlide.uniqueId}}" class="only-video--video-player" poster="/bundles/os2displaydefaulttemplate/assets/images/black.png">
<source data-src="{{ikSlide.currentVideo.webm}}" type="video/webm">
<source data-src="{{ikSlide.currentVideo.ogg}}" type="video/ogg">
<source data-src="{{ikSlide.currentVideo.mp4}}" type="video/mp4">
Your browser does not support the <code>video</code> element.
<source data-src="{{src}}" type="video/{{key}}" data-ng-repeat="(key,src) in ikSlide.currentVideo" />
Your browser does not support the <code>video</code> element.
</video>

<img class="only-video--logo" data-ng-show="ikSlide.currentLogo" data-ng-style="{'top':ikSlide.options.logopos.top, 'bottom':ikSlide.options.logopos.bottom, 'left':ikSlide.options.logopos.left, 'right':ikSlide.options.logopos.right, 'width': ikSlide.options.logosize}" data-ng-src="{{ikSlide.currentLogo}}" />
Expand Down
6 changes: 1 addition & 5 deletions Resources/public/templates/js/videoSlide.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ if (!window.slideFunctions['video']) {

if (slide.media_type === 'video' && slide.media.length > 0) {
// Set current video variable to path to video files.
slide.currentVideo = {
"mp4": slide.media[0].mp4,
"ogg": slide.media[0].ogv,
"webm": slide.media[0].webm
};
slide.currentVideo = slide.media[0];
}
},

Expand Down

0 comments on commit 139ae21

Please sign in to comment.