toMap method

Map<String, dynamic> toMap()

Creates Map representation of YoutubePlayerParams.

Implementation

Map<String, dynamic> toMap() {
  return {
    'autoplay': 1,
    'mute': _boolean(mute),
    'cc_lang_pref': captionLanguage,
    'cc_load_policy': _boolean(enableCaption),
    'color': color,
    'controls': _boolean(showControls),
    'disablekb': _boolean(!enableKeyboard),
    'enablejsapi': _boolean(enableJavaScript),
    'fs': _boolean(showFullscreenButton),
    'hl': interfaceLanguage,
    'iv_load_policy': showVideoAnnotations ? 1 : 3,
    'loop': _boolean(loop),
    'modestbranding': '1',
    if (origin != null && !kIsWeb) 'origin': origin,
    'playsinline': _boolean(playsInline),
    'rel': _boolean(!strictRelatedVideos),
  };
}