Kaltura player not making correct javascript api calls

61 replies [Last post]
Joined: 12/13/2012
Points: 9

Hello all,
I have been setting up my player on my site, and everything is working great, until I try to use the javascript api with it. Let me first show you the code I have written so far:

<object id="kaltura_player_1_tyan50je" name="kaltura_player_1_tyan50je" type="application/x-shockwave-flash" allowFullScreen="true"
            allowNetworking="all" allowScriptAccess="always" height="560" width="1000"
            data="http://www.kaltura.com/index.php/kwidget/wid/_1104952/uiconf_id/9193302">
            <param name="allowFullScreen" value="true" />
            <param name="allowNetworking" value="all" />
            <param name="allowScriptAccess" value="always" />
            <param name="bgcolor" value="#000000" />
            <param name="wmode" value="opaque"/>
            <param name="flashVars" value="emptyF=onKdpEmpty&readyF=onKdpReady&externalInterfaceDisabled=false&entryId=1_tyan50je" />
            <param name="movie" value="http://www.kaltura.com/index.php/kwidget/wid/_1104952/uiconf_id/9193332" />
            <a href="http://corp.kaltura.com/products/video-platform-features">Video Platform</a>
            <a href="http://corp.kaltura.com/Products/Features/Video-Management">Video Management</a>
            <a href="http://corp.kaltura.com/Video-Solutions">Video Solutions</a>
            <a href="http://corp.kaltura.com/Products/Features/Video-Player">Video Player</a>
        </object>

And this is the javascript (forgive the console logs)

<script type="text/javascript">

        function onKdpReady(playerId) {
            console.log("fds");

            window.myKdp = document.getElementById(playerId);

            console.log(myKdp);
            console.log(mykdp.evaluate('{entryId}'));

            myKdp.addJsListener("freePreviewEnd", "FreePreviewHasEnded");
        }

        function jsCallbackReady(objectId) {
            window.myKdp = document.getElementById(objectId);

            console.log(myKdp);
            console.log(mykdp.evaluate('{entryId}'));

            myKdp.dispatchKdpEvent('doPlay');
            myKdp.addJsListener("freePreviewEnd", "FreePreviewHasEnded");
        }

        function FreePreviewHasEnded() {
            console.log("asdf");
        }

        function onKdpEmpty(playerId) {
            console.log("go");
        }
</script>

I am working off of the example located at: http://www.kaltura.org/kdp_js_api_demo_page.html

From what I have here, only the logs in the jsCallbackReady are ever being called, and the evaluate in that method returns absolutely nothing. The dispatch event call also does not start the video. What is weird is that if I change the movie param and the data attribute to the same ending as the example (_0/uiconf_id/1000106), then the jsCallbackReady doesn't get called but the onKdpReady does, and the event bind/evaluate doesn't work either. Is there something I am missing here, or something in the syntax that isn't right? I have been making alterations to the way things are called, and have even put a setTimeout on the page to bind later on past when the page has loaded, and it still doesn't bind.

Also, the player version of the demo is 2.7 while mine is 3.6.12.1. The video also has access control of 4 seconds of preview (for testing purposes, this will be longer in production).

If anyone has any ideas, that would help. Please though, don't just post a link to the javascript api documentation. I have read all over those pages (which lack any sort of example for a base start) and have not found any solutions.

Thanks

Joined: 02/22/2009
Points: 76

You may want to check out the feature hub:
http://html5video.org/kaltura-player/docs/

There are lots of working examples there. If you aim build a preview / buy flow you can check out this sample:
http://html5video.org/kaltura-player/modules/KalturaSupport/tests/Access...

Joined: 12/13/2012
Points: 9

I'll take a look at those and see what I come up with. Thanks for the input. I am using the flash version of the player, but I will see what I can move over from these html5 examples.

Joined: 01/14/2013
Points: 13

This old url :
http://cdnsecakmi.kaltura.com/p/243342/sp/24334200/flvclipper/entry_id/1...
return full video instead of preview?

Joined: 12/19/2013
Points: 130

Needed to compose you a word regarding the nice opinions you have contributed. Your good knowledge in playing with all the pieces is very useful. To be honest, this has been one outstanding blog
phone number for income support

Joined: 06/02/2014
Points: 1088

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing...
astuce hay day

Joined: 06/02/2014
Points: 1088

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates.
costco adjustable beds

Joined: 06/02/2014
Points: 1088

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates.
luxury memory foam mattress

Joined: 06/02/2014
Points: 1088

wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated.
cheap memory foam mattress

Joined: 06/02/2014
Points: 1088

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates.
adjustable beds prices

Joined: 06/02/2014
Points: 1088

Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up!
https://rebelmouse.com/getridofherpessarahwilcox/

Joined: 06/02/2014
Points: 1088

Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site.
best deals on mattresses

Joined: 04/23/2014
Points: 396

I've just decided to create a blog, which I have been wanting to do for a while. Thanks for this post, it's really useful!
compare car insurance by zip code

Joined: 06/02/2014
Points: 1088

Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”.
memory foam mattress reviews

Joined: 02/22/2009
Points: 76

The feature hub is for both HTML5 and flash. The api shown there should work for both.

Joined: 12/13/2012
Points: 9

I have tried building the sample provided, but it seems that I still can't get it to work. Here is an example of what I have got:

Javascript:

var myKdp = null;
var myId = null;

window['doPurchaseDialog'] = function () {

    console.log("asdf");
    console.log(myId);

    var pos = $('#' + myId).position();

    $('#' + myId).after(
    $('<div />').append(
    $('<h2>Sample purchase flow:</h2>'),
    $('<br />'),
    $('<button />')
    .attr('type', 'button')
    .html('simulate purchase')
    .click(function () {
        // set to loading
        console.log("adf");
        $('.myPurchaseDialog').html('loading ...');
        // Query the service for a ks:

    })
    )
    .addClass('myPurchaseDialog')
    .css({
        'position': 'absolute',
        'top': pos.top,
        'left': pos.left,
        'width': "400px",
        'height': "330px",
        'opacity': .8,
        'background-color': 'black',
        'color': 'white'
    })
    )
}

$(function () {

    $(".videoPlayerWrapper").each(function () {

        var _this = $(this);
        myId = _this.attr("id");
       
        var wid = _this.data("wid");
        var ui = _this.data("uiconfig");
        var vid = _this.data("video");

        kWidget.embed(_this.attr("id"), {
            'wid': wid,
            'uiconf_id': ui,
            'entry_id': vid,
            'flashvars': {
                'disableAlerts': true
            },
            'readyCallback': function (playerId) {

                console.log("callback");

                myKdp = $('#' + playerId)[0];

                myKdp.addJsListener('freePreviewEnd', 'doPurchaseDialog');
            }
        });

    });
});

Html

<div id="kaltura_wrapper_1_tyan50je" style="width:1000px;height:560px;" class="videoPlayerWrapper" data-video="1_tyan50je" data-uiconfig="9193302" data-wid="_1104952"></div>

Note: There is only one player on the page, so the jquery each will only have one item to go through. I somehow got the console logs in the doPurchaseDialog to fire once, but can't ever seem to get them to call again no matter what I change. The video though shows up fine and plays fine.

Any ideas on what I am still missing?

Joined: 12/13/2012
Points: 9

Quick update on this. It is working if firefox, but not Chrome or IE.

Joined: 06/27/2013
Points: 18

I have explain so many article of this site in which some of them were very intresting and inspiring.This article has good title with good description.
Web Design New York

Joined: 10/23/2013
Points: 6

I have explain so many article of this site in which some of them were very intresting and inspiring.This article has good title with good description.Benefits of phen375

Joined: 10/23/2013
Points: 4

I have explain so many article of this site in which some of them were very intresting and inspiring.
http://www.steamlite.co.uk/

Joined: 06/02/2014
Points: 1088

I really like the dear information you offer in your articles. I'm able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone else!
https://www.rebelmouse.com/reviewsadonisgoldenratio/

Joined: 10/24/2013
Points: 6
Joined: 10/24/2013
Points: 6

I have explain so many article of this site in which some of them were very intresting and inspiring.This article has good title with good descriptionbest carry on luggage

Joined: 10/25/2013
Points: 5

I'll take a look at those and see what I come up with. Thanks for the input. I am using the flash version of the player, but I will see what I can move over from these html5 examples.
fastest vpn

Joined: 12/19/2013
Points: 130

I was very encouraged to find this site. I wanted to thank you for this special read. I definitely savored every little bit of it and I have you bookmarked to check out new stuff you post.
sky customer service telephone number

Joined: 06/02/2014
Points: 1088

Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site.
best tempurpedic mattress

Joined: 11/01/2013
Points: 4

I have explain so many article of this site in which some of them were very intresting and inspiring.This article has good title
life ins

Joined: 11/13/2013
Points: 5
Joined: 12/02/2013
Points: 5

I'll take a look at those and see what I come up with. Thanks for the input. I am using the flash version of the player, but I will see what I can move over from these html5 examples.

digital marketing phoenix

Joined: 12/04/2013
Points: 8

I have explain so many article of this site in which some of them were very intresting and inspiring.This article has good title with good description.
http://www.musclefactor-x.blogspot.com

Joined: 12/10/2013
Points: 5

I'll take a look at those and see what I come up with. Thanks for the input. I am using the flash version of the player, but I will see what I can move over from these html5 examples. pay day loans
http://www.personalcashadvance.com/

Joined: 12/12/2013
Points: 5

I'll take a look at those and see what I come up with. Thanks for the input. I am using the flash version of the player, but I will see what I can move over from these html5 examples.
http://www.actionaffiliatesgreenville.com/

Joined: 12/15/2013
Points: 5

I'll take a look at those and see what I come up with. Thanks for the input. I am using the flash version of the player, but I will see what I can move over from these html5 examples..
car insurence.
http://www.carinsurancerates.com/

Joined: 12/17/2013
Points: 4

I have explain so many article of this site in which some of them were very intresting and inspiring.This article has good title with good description.
automobile insurance for used cars

Joined: 12/25/2013
Points: 66

seems to stipulate or is this just a statistical artifact within an aggregated narrative about women that's even harder to swallow sky customer service

Joined: 01/08/2014
Points: 4

it is real that it is a good player and I will use it often for sure!
http://www.schwabingzahnarzt.de

Joined: 12/16/2013
Points: 35

GOOD
hidemyass

Joined: 06/02/2014
Points: 1088

You have raised an important issue..Thanks for sharing..I would like to read more current affairs from this blog..keep posting..
best memory foam mattress

Joined: 06/02/2014
Points: 1088

Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”.
best rated memory foam mattress

Joined: 06/02/2014
Points: 1088

I agree with your blog and i will be back to check it more in the future so please keep up your work. michael kors outleti love your content & the way that you write.
top mattresses

Joined: 06/02/2014
Points: 1088

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job!
memory foam allergy

Joined: 06/02/2014
Points: 1088

Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site.
bad back pain

Joined: 06/02/2014
Points: 1088

I agree with your blog and i will be back to check it more in the future so please keep up your work. michael kors outleti love your content & the way that you write.
memory foam chemicals

Joined: 06/02/2014
Points: 1088

I simply want to tell you that I am new to weblog and definitely liked this blog site. Very likely I’m going to bookmark your blog . You absolutely have wonderful stories. Cheers for sharing with us your blog.
tempurpedic mattress reviews

Joined: 06/02/2014
Points: 1088

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.

Joined: 06/02/2014
Points: 1088

Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”.

Joined: 06/02/2014
Points: 1088

Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site.
mattress foam

Joined: 06/02/2014
Points: 1088

I simply want to tell you that I am new to weblog and definitely liked this blog site. Very likely I’m going to bookmark your blog . You absolutely have wonderful stories. Cheers for sharing with us your blog.
icomfort bed

Joined: 06/02/2014
Points: 1088

wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated.
adjustable bed base reviews

Joined: 06/02/2014
Points: 1088

I also benefit from learning the assessments, but learn that alot of people ought to stay on essay to try and add worth in the direction of the authentic weblog release.
best memory foam mattress revie

Joined: 06/02/2014
Points: 1088

I also benefit from learning the assessments, but learn that alot of people ought to stay on essay to try and add worth in the direction of the authentic weblog release.
adjustable bed mattress