What are you using for streaming video to confluence?

Hi, I am trying to get my company to use Confluence as our intranet.  One thing I would like to have in Confluence is the ability to have training videos there.  Now I know that the multimedia macro will work to stream media, but we have several movies that are very large (2GB or more).  Our IT admins have put an upload restriction on the Confluence Server.  The other issue is that we cannot upload these to any cloud system like YouTube or Vimeo per our information security policy.

With that in mind I'd like to have another server that would run as a streaming server and then be able to "embed" something like an HTML 5 or other player in Confluence.  Basically I'd like to have an internal YouTube application.

What are others out there doing to overcome this issue? 

1 answer

0 vote
Stephen Deutsch Community Champion Jul 25, 2017

We stored some videos on an external server, and I wrote a user macro to allow embedding of external HTML5 videos in Confluence (mp4 files should be most compatible) based on a user macro of @David Simpson:

## Macro title: HTML5 Video
## Macro has a body: N
##
## @param width:title=Width|type=string|required=false|desc=Video width
## @param height:title=Height|type=string|required=false|desc=Video height
## @param poster:title=Poster|type=string|required=false|desc=Set a placeholder image
## @param src:title=Source|type=string|required=true|desc=Attached video filename
## @param External:title=External Video|type=boolean|required=true
## @param Override:title=Override Extension|type=string|required=false|desc=Enter file extension to override

#if ( $paramExternal != "true" )
#set ( $attachment = $content.getAttachmentNamed($paramsrc) )
#set ( $extension = $attachment.getFileExtension() )
#set ( $path = $attachment.getDownloadPath() )
#else
#set ( $last3 = $paramsrc.length() - 3 )
#set ( $extension = $paramsrc.substring($last3) )
#set ( $path = $paramsrc )
#end

#if ( $paramOverride )
#set ( $extension = $paramOverride )
#end

#if ( $extension == "m4v" )
#set ( $mimetype = "video/mp4" )
#else
#set ( $mimetype = "video/" + $extension )
#end

<video controls="controls"
#if ($paramwidth) width="$paramwidth" #end
#if ($paramheight) height="$paramheight" #end
#if ($paramposter) poster="$paramposter" #end ## Set a placeholder image for the video
src="$path">
<source type="$mimetype" src="$path" />
</video>
<p>
<strong>Download video:</strong> <a href="$path">$extension format</a>
</p>

I wrote another user macro to link to a specific time in the video:

## @param VideoFilename:title=Video Filename|type=string|required=true|desc=Enter file name of the video to which you want to link to a specific time
## @param Timestamp:title=Timestamp|type=string|required=true|desc=Enter timestamp in the video to which you want to jump (hh:mm:ss, mm:ss, or ss)
<a href="javascript&colon;void(0)" class="video-timestamp-link" data-video-filename="${paramVideoFilename}" data-timestamp="${paramTimestamp}">$paramTimestamp</a>
<script>

function hmsToSeconds(str) {
var p = str.split(':'),
s = 0, m = 1;
while (p.length > 0) {
s += m * parseInt(p.pop(), 10);
m *= 60;
}
return s;
}

jQuery(".video-timestamp-link").click(function() {
var v = jQuery('video[src*="' + jQuery(this).attr("data-video-filename") + '"]');
if (v.length) {
v.get(0).currentTime = hmsToSeconds(jQuery(this).attr("data-timestamp"));
}
});

</script>

 Maybe that will help :)

So that's what I was thinking... Thanks for the Macro I'll give it a shot.

So how do you have your backend server running?  Is it just a regular HTTP (like Apache or IIS)?  Or do you have some streaming server running?

Stephen Deutsch Community Champion Jul 25, 2017

Just standard HTTP, that's worked OK for us. Modern browsers are pretty good at handling static video files these days.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

964 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you