Support for kaltura #44

Closed
anointed opened this Issue Apr 7, 2012 · 12 comments

3 participants

@anointed

I've been trying to get fitvids to work with my kaltura player ( http://kaltura.org ) but just can't seem to get it to work.

Here is a 'temp' video embed code to test:

https://gist.github.com/2325974

I tried to paste in the embed code here, but it just doesn't work, hence the gist.

Basically I have to modify the fitvids.js script to force a fixed height, which of course breaks the entire concept of fitvids.

Is there an easy fix for this?

@davatron5000
Owner

FitVids is for aspect ratio based resizing. If you want to do fixed height, you'd just set a height on your object.

object { width: 100%; height: 300px; }

You probably don't need FitVids, from what it sounds like you're doing.

@anointed

I'm actually trying to use fitvids with kalura just like I would with youtube.

Right now, using fitvids, if I add a youtube video, then it 'resizes' properly, but if I use kaltura then no video shows up at all.

The only "solution" was a 'fixed height' to make the video show up at all, which is NOT want I am trying, but have no other solution at the moment.

I'm actually hoping to be able to continue using fitvids as I love what it does with all the other video players for aspect ratio. I just need to also be able to use kaltura video player as well.

Hope it makes more sense that I explained a little better.

@davatron5000
Owner

http://jsbin.com/ozisoj/2 - I got it all working using your embed code.

@anointed

When viewing the page in Firefox 12 I do not see the video at all, just hello world and a blank middle area.
In Safari 5.1 I do see the video player, but the aspect ratio is off, showing 'square' player for a widescreen video.

I can live with the Safari 'issue', but having no video in Firefox doesn't work. Windows 7 64bit

@davatron5000
Owner

It's possible it it won't work with this custom video player unless Kaltura has some kind of callback function. If I set a breakpoint at line 34 of the JSBin, it works just fine because (my guess) the Kaltura script has finished doing its script-loading and executing.

You're seeing the failure in FF because FitVids applies (and strips out height) before the video is fully loaded.

@anointed

Not sure what callbacks are etc, but maybe this helps?
http://stackoverflow.com/questions/3924775/callback-functions-from-kaltura-html5-video
http://knowledge.kaltura.com/javascript-api-kaltura-media-players

I do remember reading somewhere about callbacks for kaltura, but have zero experience with them yet. I just know that kaltura is becoming a huge platform used by many universities etc, so guessing it is rather feature complete. Sure hoping it has exactly what we need to get fitvids working :)

@anointed

If those links are not what you needed, maybe you could let me know what we are looking for and I can post over on the kaltura forums to get some advice?

I know kaltura does have callback function ability, I just don't know what needs to be done with it. Just think it would be really great to get fitvids and kaltura working nicely together.

@davatron5000
Owner

http://jsbin.com/ozisoj/4 Should work

Instead of just having $('.container').fitVids(); inside a script block, I put it within the jsCallbackReady()

<script src="path/to/jquery.js"></script>
<script src="path/to/fitvids.js"></script>
<script>
function jsCallbackReady(objectId) {
  window.kdp = document.getElementById(objectId);
  $('.container').fitVids();
}
</script>
@anointed

Awesome! it works for me on Firefox now :)

Now you can add the kaltura player to the list of supported players on the fitvids github homepage.

@anointed

Well I am back ;)
While I was easily able to replicate the fix from your fiddle for a standalone single page kaltura video, I am struggling to get it to work when using the actual kaltura all-in-one-video plugin.

Here is an example page with a kaltura video embedded into a WordPress page:
http://bit.ly/JNUcnI

You will notice that I am indeed calling fitvids properly, (it loads), and have even tried a couple of different selectors in my header, yet the video is not fluid like it is in standalone mode.

The code for the player is generated via the plugin itself, so changing that is virtually impossible for me. I did add the 'kalturavid' wrapper in an effort to have something specific to target as the span id created by kaltura is random.

Are you able to see the element I should be targeting to get fitvids to work properly?

I have tried:

  
  
@lclemente

The video on http://jsbin.com/ozisoj/4 is not working for me on FF for Linux.
I am having similar problem with code that was working until few days ago. Is it still fine for you? Just wondering if something changed Kaltura side. Not sure this make sense at all, sorry, not a JS developer.

@davatron5000
Owner

Officially we don't support Kaltura, so this is as far as I can take this with custom video players. That said, you have some basic Javascript execution problems. Your callback wasn't being called, so FitVids wasn't being applied. Just take it out of the function and the squeezing appears to be working: http://jsbin.com/ozisoj/5/edit

For more on how Javascript works, ask questions on Stack Overflow. Good luck!

@davatron5000 davatron5000 reopened this Dec 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment