BCcampus / pressbooks-textbook

A plugin that extends Pressbooks for textbook authoring
GNU General Public License v2.0
25 stars 13 forks source link

Kaltura oEmbed not working in non-Open Textbooks themes #189

Open josieg opened 5 years ago

josieg commented 5 years ago

Description

We have recently completed switching all books out of the Open Textbooks theme. However, now the oEmbeds of Kaltura videos no longer work in the new themes.

I know Brad did something a while ago to make embedding Kaltura videos possible (See #167) in the Open Textbooks theme. So I don't know if this is something we have to replicate with the other themes, or if I need to report this to Pressbooks. From what I can find in the Pressbooks core resources, Pressbooks should support oEmbedding from any source, so I don't know why this is not working.

Expected behaviour

I expect that when I copy an oEmbed link for a Kaltura video into the Pressbooks visual editor (in any theme) that the video will automatically embed and be playable from the webbook.

Actual behaviour

When I copy the oEmbed link for a Kaltura video into the Pressbooks visual editor in any theme that is not the Open Textbooks theme, the link appears as plain text. The video player does not appear.

Steps to reproduce the problem

  1. Set your book to any non-OpenTextbooks theme (Clarke or McLuhan).
  2. Copy an oEmbed link from a Kaltura video.
  3. Paste the oEmbed link into the Pressbooks video editor.
  4. Wait for the video to embed. Nothing happens.
greatislander commented 5 years ago

Hi @josieg! It looks like Brad embedded something like this: https://kb.wisc.edu/helpdesk/page.php?id=56746 in the Open Texbook theme. Here: https://github.com/BCcampus/pressbooks-textbook/blob/3af4c716a86562fa8895088fae616dea35155e0a/themes-book/opentextbook/functions.php#L24-L31

It's not a bug you should report to Pressbooks, because the only way the Pressbooks team could fix it would be to add support for BCcampus' Kaltura instance to all Pressbooks networks. A member of your team should add that function (which enables BCcampus' Kaltura site) to a small drop-in plugin in your Pressbooks instance and it should work for all themes. (FYI @steelwagstaff.)

josieg commented 5 years ago

Thanks @greatislander ! Much appreciated.

alex-418 commented 5 years ago

@josieg This has been added to both of our PB instances and it works great. Please re-open if you encounter any issues.

josieg commented 5 years ago

Woohoo! Thanks Alex :)

SteelWagstaff commented 5 years ago

Glad you got this worked out @josieg & @alex-418, and thanks for your help @greatislander! Alex, your solution would probably be of interest for other open source users -- if you've got time and inclination, you may be interested in submitting it to our https://github.com/pressbooks/snippets repo?

dshaykewich commented 4 years ago

@alex-418 -- can we further discuss this one? I'm wondering about:

  1. Is this still working now that we're not using the BCcampus custom theme (and just using McLuhan)?

  2. Can we add other institutions to the white list (so they can embed videos hosted in their Katuras into our pressbooks books)? @georgemeyer should have the list of other institutions' instances, as he acts as tier 2 support for Katura.

Clint Lalonde chatted with me and had previously built the code out as a plugin rather than a theme customization. https://github.com/clintlalonde/oEmbed-BCcampus

alex-418 commented 4 years ago

@dshaykewich

  1. Confirmed it's still working, I have tested this just now.

  2. Yes other providers can be added, please see wp_oembed_add_provider

This functionality was moved into a plugin before we moved away from the theme.

dshaykewich commented 4 years ago

Thanks @alex-418 . I'll get in touch with @georgemeyer for the list of institution instances.

kkilbey commented 4 years ago

The URL for JIBC is: https://video.jibc.ca/

kkilbey commented 4 years ago

@alex-418 Please go ahead and whitelist the JIBC URL above. Someone at JIBC is trying to embed a Kaltura video in Pressbooks, so this one is the most urgent. We can whitelist the other institutions once we have those URLs. Thank you! :)

alex-418 commented 4 years ago

@kkilbey Just saw the urgent comment on this. I've just added the JIBC url you've provided to the whitelist on pressbooks.bccampus.ca so their oEmbed links should now work as expected. One thing to note, is that I was not able to test this because I couldn't see the "share" tab with the oEmbed link in any of their videos on video.jibc.ca ... This might mean that they need to enable this feature. Also note, that media with permissions set to private will not work with oembed.

paulagaube commented 4 years ago

@alex-418 @dshaykewich Support has had a number of emails back and forth about getting a JIBC Kaltura video working in Pressbooks. I'll send you a copy of the whole email, because it won't paste in properly here.

FYI, @josieg helped me confirm that videos from the BCcampus Kaltura instance were successfully embedded and working properly on the Opentext Pressbooks site, here: https://opentextbc.ca/accessibilitytoolkit/back-matter/inclusive-design-webinar-series/