Example #1
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;
}
bool
idolConeAudio::GetPropertyByIndex (int aIndex,
                                    NPVariant *_result)
{
  IDOL_LOG_GETTER (aIndex, idolConeAudio);

  switch (Properties (aIndex)) {
    case eMute:
      return BoolVariant (_result, Plugin()->IsMute());
      
    case eVolume:
      return Int32Variant (_result, Plugin()->Volume() * 200.0);

    case eChannel:
    case eTrack:
      IDOL_WARN_GETTER_UNIMPLEMENTED (aIndex, _result);
      return VoidVariant (_result);
  }

  return false;
}
Example #3
0
bool
xplayerConeVideo::GetPropertyByIndex (int aIndex,
                                      NPVariant *_result)
{
    XPLAYER_LOG_GETTER (aIndex, xplayerConeVideo);

    switch (Properties (aIndex)) {
    case eFullscreen:
        return BoolVariant (_result, Plugin()->IsFullscreen());

    case eAspectRatio:
    case eHeight:
    case eSubtitle:
    case eTeletext:
    case eWidth:
        XPLAYER_WARN_GETTER_UNIMPLEMENTED (aIndex, _result);
        return VoidVariant (_result);
    }

    return false;
}
Example #4
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;
}
Example #5
0
bool
xplayerGMPControls::InvokeByIndex (int aIndex,
                                 const NPVariant *argv,
                                 uint32_t argc,
                                 NPVariant *_result)
{
  XPLAYER_LOG_INVOKE (aIndex, xplayerGMPControls);

  switch (Methods (aIndex)) {
    case ePause:
      /* void pause (); */
      Plugin()->Command (XPLAYER_COMMAND_PAUSE);
      return VoidVariant (_result);

    case ePlay:
      /* void play (); */
      Plugin()->Command (XPLAYER_COMMAND_PLAY);
      return VoidVariant (_result);

    case eStop:
      /* void stop (); */
      Plugin()->Command (XPLAYER_COMMAND_PAUSE);
      return VoidVariant (_result);

    case eGetAudioLanguageDescription:
      /* AUTF8String getAudioLanguageDescription (in long index); */
      XPLAYER_WARN_1_INVOKE_UNIMPLEMENTED (aIndex,xplayerGMPControls);
      return StringVariant (_result, "English");

    case eGetLanguageName:
      /* AUTF8String getLanguageName (in long LCID); */
      XPLAYER_WARN_1_INVOKE_UNIMPLEMENTED (aIndex,xplayerGMPControls);
      return StringVariant (_result, "English");

    case eIsAvailable:
      /* boolean isAvailable (in ACString name); */
      NPString name;
      if (!GetNPStringFromArguments (argv, argc, 0, name))
        return false;
      if (g_ascii_strncasecmp (name.UTF8Characters, "currentItem", name.UTF8Length) == 0
	  || g_ascii_strncasecmp (name.UTF8Characters, "next", name.UTF8Length) == 0
	  || g_ascii_strncasecmp (name.UTF8Characters, "pause", name.UTF8Length) == 0
	  || g_ascii_strncasecmp (name.UTF8Characters, "play", name.UTF8Length) == 0
	  || g_ascii_strncasecmp (name.UTF8Characters, "previous", name.UTF8Length) == 0
	  || g_ascii_strncasecmp (name.UTF8Characters, "stop", name.UTF8Length) == 0)
	      return BoolVariant (_result, true);
      return BoolVariant (_result, false);

    case eFastForward:
      /* void fastForward (); */
    case eFastReverse:
      /* void fastReverse (); */
    case eGetAudioLanguageID:
      /* long getAudioLanguageID (in long index); */
    case eNext:
      /* void next (); */
    case ePlayItem:
      /* void playItem (in xplayerIGMPMedia theMediaItem); */
    case ePrevious:
      /* void previous (); */
    case eStep:
      /* void step (in long frameCount); */
      XPLAYER_WARN_INVOKE_UNIMPLEMENTED (aIndex,xplayerGMPControls);
      return VoidVariant (_result);
  }

  return false;
}