-
Notifications
You must be signed in to change notification settings - Fork 163
ContentFilterEncryptedMedia
danielweck edited this page Nov 20, 2014
·
13 revisions
For a quick turnaround when experimenting with encrypted media resources, you may use the existing ContentFilter called "PassThroughFilter" (which by default simply passes the raw data extracted from the zip archive, no byte transformation involved).
- First, register the filter in the PopulateFilterManager() initialisation function, so that the filter can be included in the processing chain:
https://github.com/readium/readium-sdk/blob/develop/ePub3/ePub/initialization.cpp#L40
PassThroughFilter::Register();
- Then, make sure that the SniffPassThroughContent method correctly tests your resource. For example, your content filter may need to decode only certain types of audio and video files:
// "item" is a ManifestItem pointer
auto mediaType = item->MediaType();
return (mediaType == "audio/mp4" || mediaType == "audio/mpeg" || mediaType == "video/mp4" || mediaType == "video/mpeg");