Esempio n. 1
0
bool
xplayerCone::GetPropertyByIndex (int aIndex,
                               NPVariant *_result)
{
  XPLAYER_LOG_GETTER (aIndex, xplayerCone);

  switch (Properties (aIndex)) {
    case eAudio:
      return ObjectVariant (_result, Plugin()->GetNPObject (xplayerPlugin::eConeAudio));

    case eInput:
      return ObjectVariant (_result, Plugin()->GetNPObject (xplayerPlugin::eConeInput));

    case ePlaylist:
      return ObjectVariant (_result, Plugin()->GetNPObject (xplayerPlugin::eConePlaylist));

    case eVideo:
      return ObjectVariant (_result, Plugin()->GetNPObject (xplayerPlugin::eConeVideo));

    case eVersionInfo:
      return StringVariant (_result, XPLAYER_CONE_VERSION);

    case eIterator:
    case eLog:
    case eMessages:
      XPLAYER_WARN_GETTER_UNIMPLEMENTED (aIndex, _result);
      return NullVariant (_result);
  }

  return false;
}
Esempio n. 2
0
bool
totemConePlaylist::GetPropertyByIndex (int aIndex,
                                       NPVariant *_result)
{
  TOTEM_LOG_GETTER (aIndex, totemConePlaylist);

  switch (Properties (aIndex)) {
    case eItems:
      return ObjectVariant (_result, Plugin()->GetNPObject (totemPlugin::eConePlaylistItems));

    case eIsPlaying:
      return BoolVariant (_result, Plugin()->State() == TOTEM_STATE_PLAYING);
  }

  return false;
}
Esempio n. 3
0
bool
xplayerGMPPlayer::GetPropertyByIndex (int aIndex,
                                    NPVariant *_result)
{
  XPLAYER_LOG_GETTER (aIndex, xplayerGMPPlayer);

  switch (Properties (aIndex)) {
    case eControls:
      /* readonly attribute xplayerIGMPControls controls; */
      return ObjectVariant (_result, Plugin()->GetNPObject (xplayerPlugin::eGMPControls));

    case eNetwork:
      /* readonly attribute xplayerIGMPNetwork network; */
      return ObjectVariant (_result, Plugin()->GetNPObject (xplayerPlugin::eGMPNetwork));

    case eSettings:
      /* readonly attribute xplayerIGMPSettings settings; */
      return ObjectVariant (_result, Plugin()->GetNPObject (xplayerPlugin::eGMPSettings));

    case eVersionInfo:
      /* readonly attribute ACString versionInfo; */
      return StringVariant (_result, XPLAYER_GMP_VERSION_BUILD);

    case eFullScreen:
      /* attribute boolean fullScreen; */
      return BoolVariant (_result, Plugin()->IsFullscreen());

    case eWindowlessVideo:
      /* attribute boolean windowlessVideo; */
      return BoolVariant (_result, Plugin()->IsWindowless());

    case eIsOnline:
      /* readonly attribute boolean isOnline; */
      XPLAYER_WARN_1_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return BoolVariant (_result, true);

    case eEnableContextMenu:
      /* attribute boolean enableContextMenu; */
      return BoolVariant (_result, Plugin()->AllowContextMenu());

    case eClosedCaption:
      /* readonly attribute xplayerIGMPClosedCaption closedCaption; */
    case eCurrentMedia:
      /* attribute xplayerIGMPMedia currentMedia; */
    case eCurrentPlaylist:
      /* attribute xplayerIGMPPlaylist currentPlaylist; */
    case eError:
      /* readonly attribute xplayerIGMPError error; */
      XPLAYER_WARN_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return NullVariant (_result);

    case eStatus:
      /* readonly attribute AUTF8String status; */
      XPLAYER_WARN_1_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return StringVariant (_result, "OK");

    case eURL:
      /* attribute AUTF8String URL; */
      XPLAYER_WARN_1_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return StringVariant (_result, Plugin()->Src()); /* FIXMEchpe use URL()? */

    case eEnabled:
      /* attribute boolean enabled; */
      XPLAYER_WARN_1_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return BoolVariant (_result, true);

    case eOpenState:
      /* readonly attribute long openState; */
      XPLAYER_WARN_1_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return Int32Variant (_result, 0);

    case ePlayState:
      /* readonly attribute long playState; */
      return Int32Variant (_result, mPluginState);

    case eStretchToFit:
      /* attribute boolean stretchToFit; */
      XPLAYER_WARN_1_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return BoolVariant (_result, false);

    case eUiMode:
      /* attribute ACString uiMode; */
      XPLAYER_WARN_1_GETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return VoidVariant (_result);

    case eCdromCollection:
      /* readonly attribute xplayerIGMPCdromCollection cdromCollection; */
    case eDvd:
      /* readonly attribute xplayerIGMPDVD dvd; */
    case eMediaCollection:
      /* readonly attribute xplayerIGMPMediaCollection mediaCollection; */
    case ePlayerApplication:
      /* readonly attribute xplayerIGMPPlayerApplication playerApplication; */
    case ePlaylistCollection:
      /* readonly attribute xplayerIGMPPlaylistCollection playlistCollection; */
    case eIsRemote:
      /* readonly attribute boolean isRemote; */
      return ThrowSecurityError ();
  }

  return false;
}