예제 #1
0
bool
xplayerConeVideo::SetPropertyByIndex (int aIndex,
                                      const NPVariant *aValue)
{
    XPLAYER_LOG_SETTER (aIndex, xplayerConeVideo);

    switch (Properties (aIndex)) {
    case eFullscreen: {
        bool fullscreen;
        if (!GetBoolFromArguments (aValue, 1, 0, fullscreen))
            return false;

        Plugin()->SetFullscreen (fullscreen);
        return true;
    }

    case eAspectRatio:
    case eSubtitle:
    case eTeletext:
        XPLAYER_WARN_SETTER_UNIMPLEMENTED (aIndex, _result);
        return true;

    case eHeight:
    case eWidth:
        return ThrowPropertyNotWritable ();
    }

    return false;
}
bool
idolConeAudio::SetPropertyByIndex (int aIndex,
                                    const NPVariant *aValue)
{
  IDOL_LOG_SETTER (aIndex, idolConeAudio);

  switch (Properties (aIndex)) {
    case eVolume: {
      int32_t volume;
      if (!GetInt32FromArguments (aValue, 1, 0, volume))
        return false;

      Plugin()->SetVolume ((double) CLAMP (volume, 0, 200) / 200.0);
      return true;
    }

    case eMute: {
      if (!GetBoolFromArguments (aValue, 1, 0, mMute))
        return false;

      if (mMute) {
        mSavedVolume = Plugin()->Volume();
        Plugin()->SetVolume (0.0);
      } else {
        Plugin()->SetVolume (mSavedVolume);
      }
      return true;
    }

    case eChannel:
    case eTrack:
      IDOL_WARN_SETTER_UNIMPLEMENTED (aIndex, _result);
      return true;
  }

  return false;
}
예제 #3
0
bool
xplayerGMPPlayer::SetPropertyByIndex (int aIndex,
                                    const NPVariant *aValue)
{
  XPLAYER_LOG_SETTER (aIndex, xplayerGMPPlayer);

  switch (Properties (aIndex)) {
    case eFullScreen: {
      /* attribute boolean fullScreen; */
      bool enabled;
      if (!GetBoolFromArguments (aValue, 1, 0, enabled))
        return false;

      Plugin()->SetFullscreen (enabled);
      return true;
    }

    case eWindowlessVideo: {
      /* attribute boolean windowlessVideo; */
      bool enabled;
      if (!GetBoolFromArguments (aValue, 1, 0, enabled))
        return false;

      Plugin()->SetIsWindowless(enabled);
      return true;
    }

    case eURL: {
      /* attribute AUTF8String URL; */
      NPString url;
      if (!GetNPStringFromArguments (aValue, 1, 0, url))
        return false;

      Plugin()->SetSrc (url); /* FIXMEchpe: use SetURL instead?? */
      return true;
    }

    case eEnableContextMenu: {
      /* attribute boolean enableContextMenu; */
      bool enabled;
      if (!GetBoolFromArguments (aValue, 1, 0, enabled))
        return false;

      Plugin()->SetAllowContextMenu (enabled);
      return true;
    }

    case eCurrentMedia:
      /* attribute xplayerIGMPMedia currentMedia; */
    case eCurrentPlaylist:
      /* attribute xplayerIGMPPlaylist currentPlaylist; */
    case eEnabled:
      /* attribute boolean enabled; */
    case eStretchToFit:
      /* attribute boolean stretchToFit; */
    case eUiMode:
      /* attribute ACString uiMode; */
      XPLAYER_WARN_SETTER_UNIMPLEMENTED (aIndex, xplayerGMPPlayer);
      return true;

    case eCdromCollection:
      /* readonly attribute xplayerIGMPCdromCollection cdromCollection; */
    case eClosedCaption:
      /* readonly attribute xplayerIGMPClosedCaption closedCaption; */
    case eControls:
      /* readonly attribute xplayerIGMPControls controls; */
    case eDvd:
      /* readonly attribute xplayerIGMPDVD dvd; */
    case eError:
      /* readonly attribute xplayerIGMPError error; */
    case eIsOnline:
      /* readonly attribute boolean isOnline; */
    case eIsRemote:
      /* readonly attribute boolean isRemote; */
    case eMediaCollection:
      /* readonly attribute xplayerIGMPMediaCollection mediaCollection; */
    case eNetwork:
      /* readonly attribute xplayerIGMPNetwork network; */
    case eOpenState:
      /* readonly attribute long openState; */
    case ePlayerApplication:
      /* readonly attribute xplayerIGMPPlayerApplication playerApplication; */
    case ePlaylistCollection:
      /* readonly attribute xplayerIGMPPlaylistCollection playlistCollection; */
    case ePlayState:
      /* readonly attribute long playState; */
    case eSettings:
      /* readonly attribute xplayerIGMPSettings settings; */
    case eStatus:
      /* readonly attribute AUTF8String status; */
    case eVersionInfo:
      /* readonly attribute ACString versionInfo; */
      return ThrowPropertyNotWritable ();
  }

  return false;
}