Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mlewis23
Community Member

Kaltura and API

We would like to answer the question: "How many Kaltura videos have been uploaded in Canvas by faculty?".  Anyone have any suggestions on where we might start to look for this information?

Thanks,

Matt

Labels (2)
Tags (3)
10 Replies
maguire
Community Member

What about walking all of the course web pages and collecting the URLs, then filter based upon the prefix to your Kaltura server.For example, one of my course videos is at "https://play.kth.se/media/IK1552-Module11-20170420a/0_770jcngr" - so I could look for "https://play.kth.se/media". I made a simple program to do this  https://gitr.sys.kth.se/maguire/Canvas/blob/master/compute_list_of_KTH_play_URLs_on_pages_in_course....  . You can modify the prefix string you search for to suit your needs.

maguire
Community Member

For completeness I also made a program that can collect all of the URLs mentioned in a page, but that are not links (as someone might mention a link but not actually insert it into the page as a link): https://gitr.sys.kth.se/maguire/Canvas/blob/master/compute_list_of_URLs_in_text_on_pages_in_course.p...https://gitr.sys.kth.se/maguire/Canvas/blob/master/compute_list_of_URLs_in_text_on_pages_in_course.p...

 

 

mlewis23
Community Member

Thanks Gerald. I was hoping that there was a less brute force method than extracting all the urls, but since it doesn't look like any of this information is available in either the API or Canvas Data, I think you're approach is it.

The links to your python script appear to be behind a locked github door.  Are you able to share it in a different way?

With our set up it looks like Kaltura videos are referenced on page as: href="https://community.canvaslms.com/media_objects/m-AbCdEfGhIj". We will need to filter to the directory /media_objects/.

Do you know where the Syllabus content is housed? I don't think it comes in with the Course Pages, but maybe I missed it.  I suppose we will also need to sort through Assignment pages to get a full count.

maguire
Community Member

You should be able to get the programs from the following: Finding URLs and in particular URLs to KTH Play: Chip sandbox 

You could do a regular expression match against "/media_objects/", rather than doing the find with a fixed string the in the filtering function (

unique_KTH_Play_URLs(set_of_urls)

)

You can get the body of the Syllabus when doing a GET of /api/v1/courses

by including “syllabus_body". Indeed, if you include videos on assignment pages or other pages you would also have to walk those too. (When I finish my comments on a dissertation proposal perhaps I can look at adding both the Syllabus and Assignment pages to the program.)

Probably the way to do this for all courses at a university would be to actually walk the underlying database where the content is actually stored, rather that do this via the REST API.  However, I have no experience in this area (as I do not have raw database access for the university's instances of Canvas).

You get also get the information about what videos are actually being watched from the logs of the Kaltura server. This will not tell you about all of the videos that are linked, but only those actually viewed. However it would be interesting to know the ratio and to know which videos are linked but not viewed. Kaltura has an analytics API, see https://corp.kaltura.com/Products/Features/Video-Analytics . However, I have no experience with it. So far I have been content with going to the user web portal for our local Kaltura and looking at the number of times each video has been watched. Clearly, I'm not making enough use of the data that is available - which should be corrected at some later date (as I have videos for all of my lectures). 

 

mlewis23
Community Member

With how Kaltura and Canvas are integrated, we don't have a Kaltura account to access their API and Canvas does not provide direct access to the database.  However we did just hear back from our Canvas rep and what looks like the best solution will be to use the Canvas Data for requests.  We would need to filter to all request urls with '/media_objects/', and then can get a count of all 'watched' videos.  A slightly different question, but still a valuable one (if not more valuable).

I looked at the Canvas Report for External Tools, but didn't see anything for Kaltura.  Anyone know if the Canvas Data 'external_tool_activiation_dim' file has anything different?

maguire
Community Member

I added to the program and now include the URLs to KTH Play that are on the Syllabus page, see Finding URLs and in particular URLs to KTH Play: Chip sandbox  for this code.

maguire
Community Member

For  @mlewis23  added to the program to also process assignments, you can find the program compute_list_of_KTH_play_URLs_on_pages_in_course3.py  at Finding URLs and in particular URLs to KTH Play: Chip sandbox 

Are there other places that videos might appear?

Rather than going through the url where you'll can also get url requests for thumbnails as well as the video, in the Request tables from Canvas data there is a field titled "web_application_controller". One of the classifications in that field is 'media_objects'. I believe these records are showing when a Kaltura video is played.  The url for these records end in "/info" such as "/media_objects/m-5c4kXs9amqjdBa/info".

Anyone know what other web_application_controller programs are marked with the 'media_object' classification? Is it just Kaltura?

maguire
Community Member

The media objects controller in the source code (./app/controllers/media_objects_controller.rb) seems to only talk about Kaltura. Additionally, it seems that this only occurs when the media is coupled in via the CanvasKaltura  module.

Matt: How do you get your media objects in Canvas? What configuration do you have with respect to Kaltura?

When I add a video directly via the RCE it embeds it as follows:

<p><iframe style="width: 608px; height: 402px;" title="IK1552-Module11-20170420a (42:02)" src="https://kth.instructure.com/courses/2139/external_tools/retrieve?display=borderless&url=https%3A%2F%..." width="300" height="150" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" mozallowfullscreen="mozallowfullscreen"></iframe></p>

In conjunction with the above the result of a GET of 

/v1/services/kaltura

is

{ "enabled": true, "domain": "eu.nv.instructuremedia.com", "resource_domain": "eu.nv.instructuremedia.com", "rtmp_domain": "eu.fms-prod.instructuremedia.com", "partner_id": "5" }

My normal method of using video is simply referring to the videos with:

<p>An unrelated <a href="https://play.kth.se/media/IK1552-Module11-20170420a/0_770jcngr">video</a></p>

-----------------

Also one can see in the example at Google Groups that there are media_objects in the SQL database. Hence one might more efficiently collect the data from the database directly.