convertFromMap static method

PlayerConfig convertFromMap(
  1. Map<String, dynamic> map
)

Implementation

static PlayerConfig convertFromMap(Map<String, dynamic> map) {
  var shouldShowSubtitles = (map["shouldShowSubtitles"] is bool)?map["shouldShowSubtitles"] : map["shouldShowSubtitles"] == 1;
  var isMuted = (map["isMuted"] is bool)?map["isMuted"] : map["isMuted"] == 1;
  var playerStyle;
  if(map["playerStyle"] != null){
    playerStyle = PlayerStyle.convertFromMap(map["playerStyle"]);
  }

  return PlayerConfig(
    shouldShowSubtitles: shouldShowSubtitles,
    isMuted: isMuted,
    playerStyle: (playerStyle != null)?playerStyle:PlayerStyle.defaultPlayerStyle(),
  );
}