Picture of Markus Görlich
Guide on how to use third-party code in Adapt / Looking for TechSmith Camtasia Smart Player integration
by Markus Görlich - Thursday, 11 June 2020, 4:07 PM
 

Hello everyone,

I’m trying to move the TechSmith Smart Player into an Adapt component (still framework v2). Does anyone know if there already exists such a component?

The Smart Player is being used to play interactive videos from Camtasia Studio (where the video stops for a quiz and can jump to different positions depending on the answer).

I’m struggling with the basics to require the techsmith-smart-player.min.js.

index_player.html and techsmith-smart-player.min.js are the files generated by Camtasia Studio (among others). When I copy the script to a new Adapt component, I get an error here:

l.require(
  ["techsmith-smart-player.min.js"],
  function () {
    …
  }
)

Adapt can't find the resource (which is in the component/js folder).

When I don’t use the whole Loader from Camtasia and wrap the techsmith-smart-player.min.js contents in a define() (see smart-player.js) and require('./smart-player'), Adapt bundles the content correctly, but I get a TypeError: undefined is not a function (near '...})((this.TSC = this.TS...'). This is at the very end of the smart-player files.

I understand that this is quite a lot to ask, especially as it isn’t really a purely Adapt-relative question and the smart-player.js files are quite large. So I’m also very happy when someone points me to some resources on how to best use third-party code within Adapt and what to consider when using require.

Thanks

Picture of Oliver Foster
Re: Guide on how to use third-party code in Adapt / Looking for TechSmith Camtasia Smart Player integration
by Oliver Foster - Thursday, 11 June 2020, 5:04 PM
 

That's the weirdest define call I've seen yet. define(function() {}) doesn't return a function, it returns undefined.

Try the copy attached, I've reworked the define.

Picture of Markus Görlich
Re: Guide on how to use third-party code in Adapt / Looking for TechSmith Camtasia Smart Player integration
by Markus Görlich - Sunday, 14 June 2020, 3:51 PM
 

Thank you very much for your help!

Your version did work and I think I understand the problem now.

Picture of Oliver Foster
Re: Guide on how to use third-party code in Adapt / Looking for TechSmith Camtasia Smart Player integration
by Oliver Foster - Monday, 15 June 2020, 7:13 AM
 

Stupendous!

 

Glad to be of service.