JWJSONParser
@objcMembers
final public class JWJSONParser : NSObject
This JSON parser helps to convert a json object into a JWPlayerConfiguration
using the different configuration builders provided by JWPlayerKit
.
-
Convert the content of a file into a
JWPlayerConfiguration
.Note
The provided file must follow a proper JSON format.Throws
An error if the file can not be converted properly.Declaration
Swift
public static func configFromUrl(_ url: URL) throws -> JWPlayerConfiguration
Parameters
url
The
URL
to read.Return Value
A
JWPlayerConfiguration
used to configure aJWPlayer
. -
Convert a JSON object into a
JWPlayerConfiguration
.Throws
An error if the json data can not be converted properly.Declaration
Swift
public static func configFromJSON(_ jsonData: Data) throws -> JWPlayerConfiguration
Parameters
jsonData
The JSON data.
Return Value
A
JWPlayerConfiguration
used to configure aJWPlayer
.