shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

Unable to link ShakaPlayerEmbedded framework with custom eme implementation using configure flags. #155

Closed itsmefreitas closed 3 years ago

itsmefreitas commented 3 years ago

After gaining access to the Widevine prebuilt CDM repository and following the instructions on how to link Shaka Player Embedded with the exisiting CDM framework, I am unable to run my application on an iOS device, used for testing.

When running make after running the configuration script, the compiler appears to include the widevine cdm framework code or at least reference it in some way, however the XCode debugger shows me the application crash log and therein I can see the following:

widevinecdmframeworkerror

I should point out that when opening the ShakaPlayerEmbedded.framework package through Finder, I do not see any relevant files or packages/subfolders for the CDM.

I have checked that I used all the correct architecture flags and am running my app on a device corresponding to the specified parameters when running configure from this project's folder.

Is there any sort of system framework search path or custom build phase I need to add on my XCode project other than what is mentioned in the tutorial and documentation?

TheModMaker commented 3 years ago

You need to add the widevine_cdm_secured_ios.framework bundle to the Embedded binaries or Embedded Content sections in Xcode. You can find them in the prebuilt_cdm repo under lib and which version/arch you are using. For example, you could be using lib/release/arm64_ios.

itsmefreitas commented 3 years ago

Thank you for your pointers, I realized that was what is required shortly after posting this.

Would it be possible to compile the two frameworks, ShakaPlayerEmbedded and the CDM for all build architectures (without symbol stripping) so it can be packaged and distributed in App Store iOS Apps?

If so, how would you go about distributing the targets (apps) and get them approved for App Store?

TheModMaker commented 3 years ago

We will eventually add support for multi-arch builds (e.g. --cpu arm,arm64), but we only support single-arch builds at the moment. You can easily create multi-arch builds yourself by building the library separately and combining them using lipo.

itsmefreitas commented 3 years ago

Yes, thank you. I've looked into lipo today as well, it shouldn't be too complex to get it done for both frameworks.

As for app distribution, are there any license restrictions or other caveats one has to be especially alert to when dealing with the CDM and packaging it's resulting framework for App Store?

TheModMaker commented 3 years ago

We are not license experts. The main project (ShakaPlayerEmbedded.framework) is licensed under the Apache License. The other framework (ShakaPlayerEmbedded.FFmpeg.framework) is from FFmpeg and is licensed under the LGPL. Since it is a dynamic library, the rest of your app doesn't need to be GPL.

The CDM is a proprietary license under Widevine. You can only distribute it as part of your app once you have licensed with Widevine. If you have any questions about that, please contact Widevine directly.

You'll probably need to add an "about" page in your app listing the open-source projects you use, including this one, FFmpeg, and our other dependencies. You can see the summary of our dependencies and we provide a licenses.json file in the framework you could use. All those projects may not be used depending on what is built, the licenses.json file only includes those that are used.

TheModMaker commented 3 years ago

Does this answer all your questions? Can we close this issue?

itsmefreitas commented 3 years ago

Hello @TheModMaker, I apologise for the late reply and wish to thank you for your absolutely clarifying answer, it does clear all my doubts for now. The issue can be closed.