let stylePath = Bundle.main.path(forResource:"style", ofType: "css")! let scriptPath = Bundle.main.path(forResource:"script", ofType: "js")! let playerConfig = THEOplayerConfiguration(defaultCSS: false, cssPaths:[stylePath], jsPaths: [scriptPath]) /* or let playerConfig = THEOplayerConfiguration(chromeless: true, cssPaths:[stylePath], jsPaths: [scriptPath]) */
var theoplayer = THEOplayer(configuration: playerConfig)
Custom CSS and the Chromeless flag
With the chromeless flag you can choose to use the chromeless version of the player which does not contain the THEOplayer UI. This allows you to write your own custom UI.
The THEOplayer css is not loaded when chromeless is enabled.
When chromeless is false, the THEOplayer UI is used. In that case the default style can still be disabled by setting the defaultCss flag to false.
1. Register a message listener in your iOS app:
To send a message the webkit.messageHandlers.<messageName>.postMessage(<message body>) method must be used.
/* this example sends a message every 10 seconds */
Publishing to App Store
Please not that this is only necessary for versions below 2.16. Do not use this step if you have a newer version.
THEOplayer.framework is released as a FAT framework containing several architectures. The framework includes the i386, x86_64, armv7 and arm64 architectures. Sometimes the App Store will not accept these (especially legacy simulator i386 and x86_64 architectures.)
In order to thin down the framework prior to archiving it and submitting it for upload, use the following command in Terminal:
lipo [path to THEOplayer.framework] -remove [i386, x86_64] -output [path to output the thinned framework]
Replace [...] with the appropriate string