Error player error invalid operation

Error player error invalid operation Добрый день! Уважаемые читатели и гости одного из популярных IT блогов в российском сегменте Pyatilistnik.org. В прошлый раз мы с вами разбирали утилиты, позволяющие выполнить подключение к удаленному рабочему столу, это очень актуально в текущее время с удаленками. Сегодня я вам покажу, еще одну интересную фичу ESXI 6.5 и […]

Содержание

  1. Error player error invalid operation
  2. Почему выскакивает ошибка Invalid operation for device ‘0’?
  3. Как устранить ошибку Invalid operation
  4. Как расширить виртуальный диск через Vmware Workstation
  5. Как расширить виртуальный диск через PowerCLI
  6. Error player error invalid operation
  7. Required Header
  8. Overview
  9. State Diagram
  10. State Transitions
  11. State Dependent Function Calls
  12. Asynchronous Operations
  13. Callback(Event) Operations
  14. Functions
  15. Typedefs
  16. Defines
  17. Define Documentation
  18. Typedef Documentation
  19. Enumeration Type Documentation
  20. Function Documentation

Error player error invalid operation

Добрый день! Уважаемые читатели и гости одного из популярных IT блогов в российском сегменте Pyatilistnik.org. В прошлый раз мы с вами разбирали утилиты, позволяющие выполнить подключение к удаленному рабочему столу, это очень актуально в текущее время с удаленками. Сегодня я вам покажу, еще одну интересную фичу ESXI 6.5 и vCenter 7, при попытке расширить диск я получаю ошибку Invalid operation for device ‘0’. Давайте смотреть в чем дело.

Почему выскакивает ошибка Invalid operation for device ‘0’?

Расскажу немного, о своей инфраструктуре. Есть виртуальная машина с Windows Server 2012 R2, она работает в кластере ESXI 6.5, которым управляет vCenter Server 7, который мы буквально недавно обновили с версии 6.5. Мне потребовалось расширить виртуальный диск, это плевая задача, которая делается на лету, но вместо привычного положительного результата, я получил ошибку:

Target — VM Name

Status — Invalid operation for device ‘0’.

Пробовал выключить виртуальную машину, но результат оказался тем же.

Как устранить ошибку Invalid operation

Сразу хочу отметить, что это некорректная работа vCenter. Тут у нас три варианта:

  • Расширить виртуальный диск вы можете из Flash версии vCenter консоли управления, в моем случае, это было невозможно, так как я уже перешел на 7 версию, и там просто нет flash, только HTML
  • Второй вариант это использование PowerCLI оболочки, куда же без него.
  • Третий это использовать такие клиенты управления, как Vmware Workstation или VMware Remote Console

Как расширить виртуальный диск через Vmware Workstation

У меня установлен гипервизор второго типа Vmware Workstation 14 и он может подключаться к vCenter Server и выполнять базовые вещи, вы с его помощью можете расширить диск и обойти ошибку «Invalid operation for device ‘0’.». Подключитесь к vCenter Server через Vmware Workstation и перейдите в свойства виртуальной машины.

Выберите нужный виртуальный диск, после чего нажмите кнопку «Expand», введите новый размер диска и нажмите «Expand».

Через пару секунд вы увидите успешный статус «The disk was successfully expanded. You must repartition the disk and expand the file systems from whithin the quest operating system».

Единственный прикол, что у меня vCenter так и не увидел, что диск расширен, а вот сама система все прекрасно увидела.

Как видите добавленные 20 ГБ на своем месте и можно расширять том, кстати если вдруг у вас будет не активна кнопка расширения тома, то посмотрите как это исправить.

Как расширить виртуальный диск через PowerCLI

PowerCLI имеет более широкие возможности чем графический интерфейс, поэтому он легко может обойти ошибку «Invalid operation for device ‘0’.» Как устанавливать и где брать оболочку, я уже рассказывал. Подключитесь к вашему vCenter серверу, через команду:

Если выскочит ошибка «Error: Invalid server certificate», то посмотрите как ее устранить.

Теперь вам нужно в настройках виртуальной машины посмотреть номер диска, который не удается расширить, в моем примере это первый диск «Hard disk 1». Далее пишем:

После выполнения данной команды я увеличил размер диска до 220 ГБ.

Смотрим настройки виртуальной машины, там тоже все отображается как нужно.

Источник

Error player error invalid operation

The Player API provides functions for media playback and controlling media playback attributes.

Overview

The Player API provides a way to play multimedia content. Content can be played from a file, from the network, or from memory. It gives the ability to start/stop/pause/mute, set the playback position (that is, seek), perform various status queries, and control the display.

Additional functions allow registering notifications via callback functions for various state change events.

This API also enables collaboration with the GUI service to present a video.

State Diagram

Playback of multimedia content is controlled by a state machine. The following diagram shows the life cycle and states of the Player.

State Transitions

FUNCTION PRE-STATE POST-STATE SYNC TYPE
player_create() NONE IDLE SYNC
player_destroy() IDLE NONE SYNC
player_prepare() IDLE READY SYNC
player_prepare_async() IDLE READY ASYNC
player_unprepare() READY, PLAYING or PAUSED IDLE SYNC
player_start() READY or PAUSED PLAYING SYNC
player_stop() PLAYING READY SYNC
player_pause() PLAYING PAUSED SYNC

State Dependent Function Calls

The following table shows state-dependent function calls. It is forbidden to call the functions listed below in wrong states. Violation of this rule may result in unpredictable behavior.

FUNCTION VALID STATES DESCRIPTION
player_create() ANY
player_destroy() ANY
player_prepare() IDLE This function must be called after player_create()
player_unprepare() READY/PAUSED/PLAYING This function must be called after player_stop() or player_start() or player_pause()
player_start() READY/ PAUSED This function must be called after player_prepare()
player_stop() PLAYING/ PAUSED This function must be called after player_start() or player_pause()
player_pause() PLAYING This function must be called after player_start()
player_set_completed_cb()
player_set_interrupted_cb()
player_set_error_cb()
player_set_buffering_cb()
player_set_subtitle_updated_cb()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_unset_completed_cb()
player_unset_interrupted_cb()
player_unset_error_cb()
player_unset_buffering_cb()
player_unset_subtitle_updated_cb()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after register callback functions such as player_set_completed_cb()
player_get_state() ANY
player_set_uri() IDLE This function must be called before player_prepare()
player_set_memory_buffer() IDLE This function must be called before player_prepare()
player_set_subtitle_path() IDLE This function must be called before player_prepare()
player_set_volume() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_volume() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_set_sound_type() IDLE This function must be called after player_create()
player_set_mute() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_is_muted() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_set_looping() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_is_looping() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_duration() PLAYING/ PAUSED This function must be called after player_start()
player_set_display() IDLE This function must be called before player_prepare()
player_set_display_mode()
player_set_display_visible()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_display_rotation()
player_is_display_visible()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_video_size() READY/ PLAYING/ PAUSED This function must be called after player_prepare()

Asynchronous Operations

All functions that change the player state are synchronous except player_prepare_async(), player_set_play_position(), and player_capture_video(). Thus the result is passed to the application via the callback mechanism.

Callback(Event) Operations

called when a video frame is decoded

Functions

REGISTER UNREGISTER CALLBACK DESCRIPTION
player_set_completed_cb() player_unset_completed_cb() player_completed_cb() called when playback is completed
player_set_interrupted_cb() player_unset_interrupted_cb() player_interrupted_cb() called when playback is interrupted by player_interrupted_code_e
player_set_error_cb() player_unset_error_cb() player_error_cb() called when an error has occurred
player_set_buffering_cb() player_unset_buffering_cb() player_buffering_cb() called during content buffering
player_set_progressive_download_message_cb() player_unset_progressive_download_message_cb() player_pd_message_cb() called when a progressive download starts or completes
player_set_subtitle_updated_cb() player_unset_subtitle_updated_cb() player_subtitle_updated_cb() called when a subtitle updates
player_set_media_packet_video_frame_decoded_cb() player_unset_media_packet_video_frame_decoded_cb() player_media_packet_video_decoded_cb()
int player_create (player_h *player)
Creates a player handle for playing multimedia content.
int player_destroy (player_h player)
Destroys the media player handle and releases all its resources.
int player_prepare (player_h player)
Prepares the media player for playback.
int player_prepare_async (player_h player, player_prepared_cb callback, void *user_data)
Prepares the media player for playback, asynchronously.
int player_unprepare (player_h player)
Resets the media player.
int player_set_uri (player_h player, const char *uri)
Sets the data source (file-path or HTTP URI) to use.
int player_set_memory_buffer (player_h player, const void *data, int size)
Sets memory as the data source.
int player_get_state (player_h player, player_state_e *state)
Gets the player’s current state.
int player_set_volume (player_h player, float left, float right)
Sets the player’s volume.
int player_get_volume (player_h player, float *left, float *right)
Gets the player’s current volume factor.
int player_set_sound_type (player_h player, sound_type_e type)
Sets the player’s volume type.
int player_set_audio_latency_mode (player_h player, audio_latency_mode_e latency_mode)
Sets the audio latency mode.
int player_get_audio_latency_mode (player_h player, audio_latency_mode_e *latency_mode)
Gets the current audio latency mode.
int player_start (player_h player)
Starts or resumes playback.
int player_stop (player_h player)
Stops playing media content.
int player_pause (player_h player)
Pauses the player.
int player_set_play_position (player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data)
Sets the seek position for playback, asynchronously.
int player_get_play_position (player_h player, int *millisecond)
Gets the current position in milliseconds.
int player_set_mute (player_h player, bool muted)
Sets the player’s mute status.
int player_is_muted (player_h player, bool *muted)
Gets the player’s mute status.
int player_set_looping (player_h player, bool looping)
Sets the player’s looping status.
int player_is_looping (player_h player, bool *looping)
Gets the player’s looping status.
int player_set_display (player_h player, player_display_type_e type, player_display_h display)
Sets the video display.
int player_set_media_packet_video_frame_decoded_cb (player_h player, player_media_packet_video_decoded_cb callback, void *user_data)
Registers a media packet video callback function to be called once per frame.
int player_unset_media_packet_video_frame_decoded_cb (player_h player)
Unregisters the callback function.
int player_capture_video (player_h player, player_video_captured_cb callback, void *user_data)
Captures the video frame, asynchronously.
int player_set_streaming_cookie (player_h player, const char *cookie, int size)
Sets the cookie for streaming playback.
int player_set_streaming_user_agent (player_h player, const char *user_agent, int size)
Sets the streaming user agent for playback.
int player_get_streaming_download_progress (player_h player, int *start, int *current)
Gets the download progress for streaming playback.
int player_set_completed_cb (player_h player, player_completed_cb callback, void *user_data)
Registers a callback function to be invoked when the playback is finished.
int player_unset_completed_cb (player_h player)
Unregisters the callback function.
int player_set_interrupted_cb (player_h player, player_interrupted_cb callback, void *user_data)
Registers a callback function to be invoked when the playback is interrupted or the interrupt is completed.
int player_unset_interrupted_cb (player_h player)
Unregisters the callback function.
int player_set_error_cb (player_h player, player_error_cb callback, void *user_data)
Registers a callback function to be invoked when an error occurs.
int player_unset_error_cb (player_h player)
Unregisters the callback function.
int player_set_buffering_cb (player_h player, player_buffering_cb callback, void *user_data)
Registers a callback function to be invoked when there is a change in the buffering status of a media stream.
int player_unset_buffering_cb (player_h player)
Unregisters the callback function.
int player_set_progressive_download_path (player_h player, const char *path)
Sets a path to download, progressively.
int player_get_progressive_download_status (player_h player, unsigned long *current, unsigned long *total_size)
Gets the status of progressive download.
int player_set_progressive_download_message_cb (player_h player, player_pd_message_cb callback, void *user_data)
Registers a callback function to be invoked when progressive download is started or completed.
int player_unset_progressive_download_message_cb (player_h player)
Unregisters the callback function.
int player_set_playback_rate (player_h player, float rate)
Sets the playback rate.

Typedefs

typedef struct player_s * player_h
The media player’s type handle.
typedef void * player_display_h
The player display handle.
typedef void(* player_prepared_cb )(void *user_data)
Called when the media player is prepared.
typedef void(* player_completed_cb )(void *user_data)
Called when the media player is completed.
typedef void(* player_seek_completed_cb )(void *user_data)
Called when the seek operation is completed.
typedef void(* player_interrupted_cb )(player_interrupted_code_e code, void *user_data)
Called when the media player is interrupted.
typedef void(* player_error_cb )(int error_code, void *user_data)
Called when an error occurs in the media player.
typedef void(* player_buffering_cb )(int percent, void *user_data)
Called when the buffering percentage of the media playback is updated.
typedef void(* player_pd_message_cb )(player_pd_message_type_e type, void *user_data)
Called when progressive download is started or completed.
typedef void(* player_video_captured_cb )(unsigned char *data, int width, int height, unsigned int size, void *user_data)
Called when the video is captured.
typedef void(* player_media_packet_video_decoded_cb )(media_packet_h pkt, void *user_data)
Called to register for notifications about delivering media packet when every video frame is decoded.

Defines

#define GET_DISPLAY(x) (void*)(x)
Definition for a display handle from evas object.

Define Documentation

Definition for a display handle from evas object.

Typedef Documentation

typedef void(* player_buffering_cb)(int percent, void *user_data)

Called when the buffering percentage of the media playback is updated.

If the buffer is full, it will return 100%.

Parameters:

[in] percent The percentage of buffering completed (0

100)

[in] user_data The user data passed from the callback registration function

See also: player_set_buffering_cb() player_unset_buffering_cb()

Called when the media player is completed.

It will be invoked when player has reached the end of the stream.

Parameters:

[in] user_data The user data passed from the callback registration function

Precondition: It will be invoked when the playback is completed if you register this callback using player_set_completed_cb(). See also: player_set_completed_cb() player_unset_completed_cb()

The player display handle.

typedef void(* player_error_cb)(int error_code, void *user_data)

Called when an error occurs in the media player.

Since : 2.3.1 Parameters:

[in] error_code The error code
[in] user_data The user data passed from the callback registration function

See also: player_set_error_cb() player_unset_error_cb() player_error_e

The media player’s type handle.

typedef void(* player_interrupted_cb)(player_interrupted_code_e code, void *user_data)

Called when the media player is interrupted.

Since : 2.3.1 Parameters:

[in] error_code The interrupted error code
[in] user_data The user data passed from the callback registration function

See also: player_set_interrupted_cb() player_unset_interrupted_cb()

typedef void(* player_media_packet_video_decoded_cb)(media_packet_h pkt, void *user_data)

Called to register for notifications about delivering media packet when every video frame is decoded.

Since : 2.3.1 Remarks: This function is issued in the context of gstreamer so the UI update code should not be directly invoked.
the packet should be released by media_packet_destroy() after use.
Otherwises, decoder can’t work more because it can’t have enough buffer to fill decoded frame. Parameters:

[in] pkt Reference pointer to the media packet
[in] user_data The user data passed from the callback registration function

typedef void(* player_pd_message_cb)(player_pd_message_type_e type, void *user_data)

Called when progressive download is started or completed.

Since : 2.3.1 Parameters:

[in] type The message type for progressive download
[in] user_data The user data passed from the callback registration function

See also: player_set_progressive_download_path()

Called when the media player is prepared.

It will be invoked when player has reached the begin of stream.

Parameters:

[in] user_data The user data passed from the callback registration function

Precondition: player_prepare_async() will cause this callback. Postcondition: The player state will be PLAYER_STATE_READY. See also: player_prepare_async()

Called when the seek operation is completed.

Since : 2.3.1 Parameters:

[in] user_data The user data passed from the callback registration function

See also: player_set_play_position()

typedef void(* player_video_captured_cb)(unsigned char *data, int width, int height, unsigned int size, void *user_data)

Called when the video is captured.

Since : 2.3.1 Remarks: The color space format of the captured image is IMAGE_UTIL_COLORSPACE_RGB888. Parameters:

[in] data The captured image buffer
[in] width The width of the captured image
[in] height The height of the captured image
[in] size The size of the captured image
[in] user_data The user data passed from the callback registration function

See also: player_capture_video()

Enumeration Type Documentation

Enumeration for audio latency mode.

Since : 2.3.1 Enumerator:

Low audio latency mode

Middle audio latency mode

High audio latency mode

Enumeration for display type.

Since : 2.3.1 Enumerator:

Overlay surface display

This disposes off buffers

Enumeration for media player’s error codes.

Since : 2.3.1 Enumerator:

PLAYER_DISPLAY_TYPE_OVERLAY

No such file or directory

No space left on the device

Seek operation failure

File format not supported

Sound policy error

Streaming connection failed

Video capture failed

License for future use

Format not permitted

Enumeration for media player’s interruption type.

Since : 2.3.1 Enumerator:

PLAYER_ERROR_NONE
PLAYER_ERROR_INVALID_PARAMETER
PLAYER_ERROR_INVALID_OPERATION
PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE
PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE
PLAYER_ERROR_NOT_SUPPORTED_FILE
PLAYER_ERROR_CONNECTION_FAILED
PLAYER_ERROR_VIDEO_CAPTURE_FAILED
PLAYER_ERROR_DRM_NOT_PERMITTED
PLAYER_ERROR_PERMISSION_DENIED

Interrupted by a non-resumable media application

Interrupted by an incoming call

Interrupted by unplugging headphones

Interrupted by a resource conflict

Interrupted by an alarm

Interrupted by an emergency

Interrupted by a notification

Enumeration for progressive download message type.

Since : 2.3.1 Enumerator:

PLAYER_INTERRUPTED_COMPLETED
PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG
PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT
PLAYER_INTERRUPTED_BY_EMERGENCY
PLAYER_INTERRUPTED_BY_NOTIFICATION

Progressive download is started

Progressive download is completed

Enumeration for media player state.

Since : 2.3.1 Enumerator:

Player is not created

Player is created, but not prepared

Player is ready to play media

Player is playing media

Player is paused while playing media

Function Documentation

int player_capture_video ( player_h player,
player_video_captured_cb callback,
void * user_data
)

Captures the video frame, asynchronously.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation Video type should be set using player_set_display() otherwises, audio stream is only processed even though video file is set.
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause(). Postcondition: It invokes player_video_captured_cb() when capture completes, if you set a callback. See also: player_video_captured_cb()

Creates a player handle for playing multimedia content.

Since : 2.3.1 Remarks: You must release player by using player_destroy().
Although you can create multiple player handles at the same time, the player cannot guarantee proper operation because of limited resources, such as audio or display device. Parameters:

[out] player A new handle to the media player

Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_OUT_OF_MEMORY Out of memory
PLAYER_ERROR_INVALID_OPERATION Invalid operation

Postcondition: The player state will be PLAYER_STATE_IDLE. See also: player_destroy()

Destroys the media player handle and releases all its resources.

Since : 2.3.1 Remarks: To completely shutdown player operation, call this function with a valid player handle from any player state. Parameters:

[in] player The handle to the media player to be destroyed

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

Precondition: The player state must be set to PLAYER_STATE_IDLE. Postcondition: The player state will be PLAYER_STATE_NONE. See also: player_create()

int player_get_audio_latency_mode ( player_h player,
audio_latency_mode_e * latency_mode
)

Gets the current audio latency mode.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[out] latency_mode The latency mode to get from the audio

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

See also: audio_latency_mode_e player_set_audio_latency_mode()

int player_get_play_position ( player_h player,
int * millisecond
)

Gets the current position in milliseconds.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[out] millisecond The current position in milliseconds

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_SEEK_FAILED Seek operation failure

Precondition: The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. See also: player_set_play_position()

int player_get_progressive_download_status ( player_h player,
unsigned long * current,
unsigned long * total_size
)

Gets the status of progressive download.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[out] current The current download position (bytes)
[out] total_size The total size of the file (bytes)

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The progressive download path must be set by calling player_set_progressive_download_path(). The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause().

Gets the player’s current state.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[out] state The current state of the player

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter

See also: player_state_e

int player_get_streaming_download_progress ( player_h player,
int * start,
int * current
)

Gets the download progress for streaming playback.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[out] start The starting position in percentage [0, 100]
[out] current The current position in percentage [0, 100]

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause().

int player_get_volume ( player_h player,
float * left,
float * right
)

Gets the player’s current volume factor.

The range of left and right is from 0 to 1.0 , inclusive (1.0 = 100%). This function gets the player volume, not the system volume. To get the system volume, use the Sound Manager API.

Parameters:

[in] player The handle to the media player
[out] left The current left volume scalar
[out] right The current right volume scalar

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

See also: player_set_volume()

int player_is_looping ( player_h player,
bool * looping
)

Gets the player’s looping status.

If the looping status is true , playback automatically restarts upon finishing. If it is false , it won’t.

Parameters:

[in] player The handle to the media player
[out] looping The looping status: ( true = looping, false = non-looping )

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. See also: player_set_looping()

Gets the player’s mute status.

If the mute status is true , no sounds are played. If it is false , sounds are played at the previously set volume level.

Parameters:

[in] player The handle to the media player
[out] muted The current mute status: ( true = mute, false = not muted)

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

Precondition: The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. See also: player_set_mute()

Pauses the player.

Since : 2.3.1 Remarks: You can resume playback using player_start(). Parameters:

[in] player The handle to the media player

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid state
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state
PLAYER_ERROR_SOUND_POLICY Sound policy error

Precondition: The player state must be set to PLAYER_STATE_PLAYING. Postcondition: The player state will be PLAYER_STATE_READY. See also: player_start()

Prepares the media player for playback.

Since : 2.3.1 Remarks: The mediastorage privilege(http://tizen.org/privilege/mediastorage) should be added if any video/audio files are used to play located in the internal storage. The externalstorage privilege(http://tizen.org/privilege/externalstorage) should be added if any video/audio files are used to play located in the external storage. The internet privilege(http://tizen.org/privilege/internet) should be added if any URLs are used to play from network. Parameters:

[in] player The handle to the media player

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_URI Invalid URI
PLAYER_ERROR_NO_SUCH_FILE File not found
PLAYER_ERROR_NOT_SUPPORTED_FILE File not supported
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state
PLAYER_ERROR_PERMISSION_DENIED Permission denied

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play. Postcondition: The player state will be PLAYER_STATE_READY. See also: player_prepare_async() player_unprepare() player_set_uri()

int player_prepare_async ( player_h player,
player_prepared_cb callback,
void * user_data
)

Prepares the media player for playback, asynchronously.

Since : 2.3.1 Remarks: The mediastorage privilege(http://tizen.org/privilege/mediastorage) should be added if any video/audio files are used to play located in the internal storage. The externalstorage privilege(http://tizen.org/privilege/externalstorage) should be added if any video/audio files are used to play located in the external storage. The internet privilege(http://tizen.org/privilege/internet) should be added if any URLs are used to play from network. Parameters:

[in] player The handle to the media player
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_URI Invalid URI
PLAYER_ERROR_NO_SUCH_FILE File not found
PLAYER_ERROR_NOT_SUPPORTED_FILE File not supported
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state
PLAYER_ERROR_PERMISSION_DENIED Permission denied

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play. Postcondition: It invokes player_prepared_cb() when playback is prepared. See also: player_prepare() player_prepared_cb() player_unprepare() player_set_uri()

int player_set_audio_latency_mode ( player_h player,
audio_latency_mode_e latency_mode
)

Sets the audio latency mode.

Since : 2.3.1 Remarks: The default audio latency mode of the player is AUDIO_LATENCY_MODE_MID. To get the current audio latency mode, use player_get_audio_latency_mode(). If it’s high mode, audio output interval can be increased so, it can keep more audio data to play. But, state transition like pause or resume can be more slower than default(mid) mode. Parameters:

[in] player The handle to the media player
[in] latency_mode The latency mode to be applied to the audio

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

See also: audio_latency_mode_e player_get_audio_latency_mode()

int player_set_buffering_cb ( player_h player,
player_buffering_cb callback,
void * user_data
)

Registers a callback function to be invoked when there is a change in the buffering status of a media stream.

Since : 2.3.1 Remarks: The media resource should be streamed over the network. Parameters:

[in] player The handle to the media player
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature

Postcondition: player_buffering_cb() will be invoked. See also: player_unset_buffering_cb() player_set_uri() player_buffering_cb()

int player_set_completed_cb ( player_h player,
player_completed_cb callback,
void * user_data
)

Registers a callback function to be invoked when the playback is finished.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

Postcondition: player_completed_cb() will be invoked. See also: player_unset_completed_cb() player_completed_cb() player_start()

int player_set_display ( player_h player,
player_display_type_e type,
player_display_h display
)

Sets the video display.

Since : 2.3.1 Remarks: To get display to set, use GET_DISPLAY(). To use the multiple surface display mode, use player_set_display() again with a different display type. Parameters:

[in] player The handle to the media player
[in] type The display type
[in] display The handle to display

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. See also: player_set_display_rotation

int player_set_error_cb ( player_h player,
player_error_cb callback,
void * user_data
)

Registers a callback function to be invoked when an error occurs.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

Postcondition: player_error_cb() will be invoked. See also: player_unset_error_cb() player_error_cb()

int player_set_interrupted_cb ( player_h player,
player_interrupted_cb callback,
void * user_data
)

Registers a callback function to be invoked when the playback is interrupted or the interrupt is completed.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

Postcondition: player_interrupted_cb() will be invoked. See also: player_unset_interrupted_cb() player_interrupted_code_e player_interrupted_cb()

int player_set_looping ( player_h player,
bool looping
)

Sets the player’s looping status.

If the looping status is true , playback automatically restarts upon finishing. If it is false , it won’t. The default value is false .

Parameters:

[in] player The handle to the media player
[in] looping The new looping status: ( true = looping, false = non-looping )

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. See also: player_is_looping()

int player_set_media_packet_video_frame_decoded_cb ( player_h player,
player_media_packet_video_decoded_cb callback,
void * user_data
)

Registers a media packet video callback function to be called once per frame.

Since : 2.3.1 Remarks: This function should be called before preparing.
A registered callback is called on the internal thread of the player.
A video frame can be retrieved using a registered callback as a media packet.
The callback function holds the same buffer that will be drawn on the display device.
So if you change the media packet in a registerd callback, it will be displayed on the device
and the media packet is available until it’s destroyed by media_packet_destroy(). Parameters:

[in] player The handle to the media player
[in] callback The callback function to be registered
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_STATE Invalid state

Precondition: The player’s state should be PLAYER_STATE_IDLE. And, PLAYER_DISPLAY_TYPE_NONE should be set by calling player_set_display. See also: player_unset_media_packet_video_frame_decoded_cb

int player_set_memory_buffer ( player_h player,
const void * data,
int size
)

Sets memory as the data source.

Associates media content, cached in memory, with the player. Unlike the case of player_set_uri(), the media resides in memory. If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.

Since : 2.3.1 Remarks: If you provide an invalid data, you won’t receive an error message until you call player_start(). Parameters:

[in] player The handle to the media player
[in] data The memory pointer of media data
[in] size The size of media data

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). See also: player_set_uri()

Sets the player’s mute status.

If the mute status is true , no sounds are played. If it is false , sounds are played at the previously set volume level. Until this function is called, by default the player is not muted.

Parameters:

[in] player The handle to the media player
[in] muted The new mute status: ( true = mute, false = not muted)

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

Precondition: The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. See also: player_is_muted()

int player_set_play_position ( player_h player,
int millisecond,
bool accurate,
player_seek_completed_cb callback,
void * user_data
)

Sets the seek position for playback, asynchronously.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] millisecond The position in milliseconds from the start to the seek point
[in] accurate If true the selected position is returned, but this might be considerably slow, otherwise false
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_SEEK_FAILED Seek operation failure

Precondition: The player state must be one of these: PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. Postcondition: It invokes player_seek_completed_cb() when seek operation completes, if you set a callback. See also: player_get_play_position()

Sets the playback rate.

The default value is 1.0 .

Remarks: PLAYER_ERROR_INVALID_OPERATION occurs when streaming playback. No operation is performed, if rate is 0 . The sound is muted, when playback rate is under 0.0 and over 2.0 . Parameters:

[in] player The handle to the media player
[in] rate The playback rate (-5.0x

5.0x)

Return values:

PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be set to PLAYER_STATE_PLAYING by calling player_start(). The player state must be set to PLAYER_STATE_READY by calling player_prepare() or set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause().

int player_set_progressive_download_message_cb ( player_h player,
player_pd_message_cb callback,
void * user_data
)

Registers a callback function to be invoked when progressive download is started or completed.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] callback The callback function to register
[in] user_data The user data to be passed to the callback function

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature

Precondition: The path to download must be set by calling player_set_progressive_download_path(). Postcondition: player_pd_message_cb() will be invoked. See also: player_unset_progressive_download_message_cb() player_set_progressive_download_path()

int player_set_progressive_download_path ( player_h player,
const char * path
)

Sets a path to download, progressively.

Since : 2.3.1 Remarks: Progressive download will be started when you invoke player_start(). Parameters:

[in] player The handle to the media player
[in] path The absolute path to download

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state
PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). See also: player_set_progressive_download_message_cb() player_unset_progressive_download_message_cb()

Sets the player’s volume type.

Since : 2.3.1 Remarks: The default sound type of the player is SOUND_TYPE_MEDIA. To get the current sound type, use sound_manager_get_current_sound_type(). Parameters:

[in] player The handle to the media player
[in] type The sound type

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create(). See also: sound_manager_get_current_sound_type()

int player_set_streaming_cookie ( player_h player,
const char * cookie,
int size
)

Sets the cookie for streaming playback.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] cookie The cookie to set
[in] size The size of the cookie

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). See also: player_set_streaming_user_agent()

int player_set_streaming_user_agent ( player_h player,
const char * user_agent,
int size
)

Sets the streaming user agent for playback.

Since : 2.3.1 Parameters:

[in] player The handle to the media player
[in] user_agent The user agent to set
[in] size The size of the user agent

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). See also: player_set_streaming_cookie()

int player_set_uri ( player_h player,
const char * uri
)

Sets the data source (file-path or HTTP URI) to use.

Associates media contents, referred to by the URI, with the player. If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.

Since : 2.3.1 Remarks: If you use HTTP, URI should start with «http://». The default protocol is «file://». If you provide an invalid URI, you won’t receive an error message until you call player_start(). Parameters:

[in] player The handle to the media player
[in] uri The content location, such as the file path or HTTP URI

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state

Precondition: The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). See also: player_set_memory_buffer()

int player_set_volume ( player_h player,
float left,
float right
)

Sets the player’s volume.

Setting this volume adjusts the player’s instance volume, not the system volume. The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0. To change system volume, use the Sound Manager API. Finally, it does not support to set other value into each channel currently.

Parameters:

[in] player The handle to the media player
[in] left The left volume scalar
[in] right The right volume scalar

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation

See also: player_get_volume()

Starts or resumes playback.

Plays current media content, or resumes play if paused.

Parameters:

[in] player The handle to the media player

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state
PLAYER_ERROR_CONNECTION_FAILED Network connection failed
PLAYER_ERROR_SOUND_POLICY Sound policy error

Precondition: player_prepare() must be called before calling this function. The player state must be set to PLAYER_STATE_READY by calling player_prepare() or set to PLAYER_STATE_PAUSED by calling player_pause(). Postcondition: The player state will be PLAYER_STATE_PLAYING. It invokes player_completed_cb() when playback completes, if you set a callback with player_set_completed_cb(). It invokes player_pd_message_cb() when progressive download starts or completes, if you set a download path with player_set_progressive_download_path() and a callback with player_set_progressive_download_message_cb(). See also: player_prepare() player_prepare_async() player_stop() player_pause() player_set_completed_cb() player_completed_cb() player_set_progressive_download_path() player_set_progressive_download_message_cb() player_pd_message_cb()

Stops playing media content.

Since : 2.3.1 Parameters:

[in] player The handle to the media player

Returns: 0 on success, otherwise a negative error value Return values:

PLAYER_ERROR_NONE Successful
PLAYER_ERROR_INVALID_PARAMETER Invalid state
PLAYER_ERROR_INVALID_OPERATION Invalid operation
PLAYER_ERROR_INVALID_STATE Invalid player state
PLAYER_ERROR_SOUND_POLICY Sound policy error

Precondition: The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause(). Postcondition: The player state will be PLAYER_STATE_READY. The downloading will be aborted if you use progressive download. See also: player_start() player_pause()

Resets the media player.

The most recently used media is reset and no longer associated with the player. Playback is no longer possible. If you want to use the player again, you will have to set the data URI and call player_prepare() again.

Источник

Обновлено 28.12.2020

vmware logo

Добрый день! Уважаемые читатели и гости одного из популярных IT блогов в российском сегменте Pyatilistnik.org. В прошлый раз мы с вами разбирали утилиты, позволяющие выполнить подключение к удаленному рабочему столу, это очень актуально в текущее время с удаленками. Сегодня я вам покажу, еще одну интересную фичу ESXI 6.5 и vCenter 7, при попытке расширить диск я получаю ошибку Invalid operation for device ‘0’. Давайте смотреть в чем дело.

Почему выскакивает ошибка Invalid operation for device ‘0’?

Расскажу немного, о своей инфраструктуре. Есть виртуальная машина с Windows Server 2012 R2, она работает в кластере ESXI 6.5, которым управляет vCenter Server 7, который мы буквально недавно обновили с версии 6.5. Мне потребовалось расширить виртуальный диск, это плевая задача, которая делается на лету, но вместо привычного положительного результата, я получил ошибку:

Task name — Reconfigure virtual machine

Target — VM Name

Status — Invalid operation for device ‘0’.

Пробовал выключить виртуальную машину, но результат оказался тем же.

Invalid operation for device '0'.

Как устранить ошибку Invalid operation

Сразу хочу отметить, что это некорректная работа vCenter. Тут у нас три варианта:

  • Расширить виртуальный диск вы можете из Flash версии vCenter консоли управления, в моем случае, это было невозможно, так как я уже перешел на 7 версию, и там просто нет flash, только HTML
  • Второй вариант это использование PowerCLI оболочки, куда же без него.
  • Третий это использовать такие клиенты управления, как Vmware Workstation или VMware Remote Console

Как расширить виртуальный диск через Vmware Workstation

У меня установлен гипервизор второго типа Vmware Workstation 14 и он может подключаться к vCenter Server и выполнять базовые вещи, вы с его помощью можете расширить диск и обойти ошибку «Invalid operation for device ‘0’.». Подключитесь к vCenter Server через Vmware Workstation и перейдите в свойства виртуальной машины.

Выберите нужный виртуальный диск, после чего нажмите кнопку «Expand», введите новый размер диска и нажмите «Expand».

Как расширить виртуальный диск через Vmware Workstation

Через пару секунд вы увидите успешный статус «The disk was successfully expanded. You must repartition the disk and expand the file systems from whithin the quest operating system».

Единственный прикол, что у меня vCenter так и не увидел, что диск расширен, а вот сама система все прекрасно увидела.

Устраняем ошибку Invalid operation for device '0'.

Как видите добавленные 20 ГБ на своем месте и можно расширять том, кстати если вдруг у вас будет не активна кнопка расширения тома, то посмотрите как это исправить.

Как исправить Invalid operation for device '0'.

Как расширить виртуальный диск через PowerCLI

PowerCLI имеет более широкие возможности чем графический интерфейс, поэтому он легко может обойти ошибку «Invalid operation for device ‘0’.» Как устанавливать и где брать оболочку, я уже рассказывал.  Подключитесь к вашему vCenter серверу, через команду:

Connect-VIServer dns-имя vcenter сервера

Если выскочит ошибка «Error: Invalid server certificate», то посмотрите как ее устранить.

Теперь вам нужно в настройках виртуальной машины посмотреть номер диска, который не удается расширить, в моем примере это первый диск «Hard disk 1». Далее пишем:

Get-HardDisk -vm имя виртуальной машины | where {$_.name -eq «Hard disk 1»} | Set-HardDisk —capacityGB 220

После выполнения данной команды я увеличил размер диска до 220 ГБ.

Как расширить виртуальный диск через PowerCLI

Смотрим настройки виртуальной машины, там тоже все отображается как нужно.

Настройки виртуальной машины ESXI 6.5

На этом все, мы успешно обошли данную ошибку. С вами был Иван Семин, автор и создатель IT портала Pyatilistnik.org.

2.1. AVPlayManagerObject

Defines a WebApi object instance of the Tizen Samsung Product API.
The webapis.AVPlay object enables access to AVPlay API functionality.


[NoInterfaceObject] interface AVPlayManagerObject {
  readonly attribute AVPlayManager avplay;
};

WebApi implements AVPlayManagerObject;

Attributes

  • readonly AVPlayManager avplay

    AVPlay API namespace

2.2. AVPlayManager

Provides methods for the AVPlay functionalities.


[NoInterfaceObject] interface AVPlayManager {
  void open(DOMString url) ;
  void close() ;
  void prepare() ;
  void prepareAsync(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) ;
  void setDisplayRect( unsigned long x, unsigned long y, unsigned long width, unsigned long height ) ;
  void play() ;
  void seekTo(long milliseconds, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
  void stop() ;
  AVPlayPlayerState getState() ;
  void pause() ;
  void jumpForward(long milliseconds, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) ;
  void jumpBackward( long milliseconds, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback ) ;
  unsigned long getDuration() ;
  unsigned long getCurrentTime() ;
  void setTimeoutForBuffering(unsigned long seconds);
  void setBufferingParam(AVPlayBufferOption option, AVPlayBufferSizeUnit unit, unsigned long amount);
  void setSpeed(long playbackSpeed)  ;
  void setListener(AVPlayPlaybackCallback playbackCallback)  ;
  DOMString setDrm(AVPlayDrmType drmType, AVPlayDrmOperation drmOperation, DOMString jsonParam)  ;  
  DOMString getUID(AVPlayDrmType drmType)  ;
  void setSoundAnalysisListener(AVPlaySoundAnalysisCallback soundAnalysisCallback)  ;
  void unsetSoundAnalysisListener()  ;
  void setSilentSubtitle(boolean onoff)  ;
  void setExternalSubtitlePath(DOMString filePath)  ;
  void setSubtitlePosition(long position)  ;
  void setDisplayMethod(AVPlayDisplayMode displayMode)  ;
  void setSelectTrack(AVPlayStreamType trackType, long trackIndex)  ;
  AVPlayStreamInfo getCurrentStreamInfo()  ;
  AVPlayStreamInfo[] getTotalTrackInfo()  ;
  void setStreamingProperty(AVPlayStreamingPropertyType propertyType, DOMString propertyParam)  ;  
  DOMString getStreamingProperty(AVPlayStreamingPropertyType propertyType)  ;
  DOMString getVersion()  ;
  void suspend() ;
 void restore(DOMString URL, optional unsigned long? resumeTime, optional boolean? bPrepare);
  void restoreAsync(DOMString URL, optional unsigned long? resumeTime, optioanl boolean? bPrepare, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
};

Methods

open

Instantiates the player object with a content URL as the input parameter.


void open(DOMString url);

Product : TV, AV_BD, B2B (LFD, IWB)

Parameters:

  • url: Content URL for playback. It can be an absolute local path or a remote URL from a network-based stream server.

Constraint

  • Can be called in the following states: «NONE», «IDLE»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.open(url);
	}
	catch (e) 
	{
	console.log(e);
	}

close

Destroys the player object.

Product : TV, AV_BD, B2B (LFD, IWB)

Constraint

  • Can be called in the following states: «NONE», «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.close();
	} 
	catch (e) 
	{
	console.log(e);
	}

prepare

Prepares the media player for playback synchronously. The player must already be created with a valid URI.

Product : TV, AV_BD, B2B (LFD)

Constraint

  • Can be called in the following states: «IDLE», «READY»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.prepare();
	} 
	catch (e) 
	{
	console.log(e);
	}

prepareAsync

Prepares the media player for playback asynchronously. This method is preferred over prepare because it returns immediately and does not block the application thread during preparation.
When preparation is successful, the success callback is returned and the player is in READY state. If preparation fails, the error callback returns the error value.
When prepareAsync is used with «PREBUFFER_MODE», successCallback is invoked when prebuffering is complete, instead of when preparation is complete.


void prepareAsync(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • successCallback: Callback method to invoke when the call is successful
  • errorCallback: Callback method to invoke when an error occurs

Constraint

  • Can be called in the following states: «IDLE», «READY»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.prepareAsync(successCallback, errorCallback);

setDisplayRect

Sets the display area for video content playback. The 4 parameters specify the left side, top, window width, and window height based on a 1920 x 1080 resolution screen, regardless of the actual application resolution.


void setDisplayRect( unsigned long x, unsigned long y, unsigned long width, unsigned long height );

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • x: Display area top-left X-coordinate. Must be less than the TV screen width.
  • y: Display area top-left Y-coordinate. Must be less than the TV screen height.
  • width: Display area width. Must be less than the TV screen width.
  • height: Display area height from source image. Must be less than the source image height.

Constraint

  • Can be called in the following states: «IDLE», «READY», «PLAYING», «PAUSED» (when APP is using normal calling sequence , OPEN+setDisplay+PREPARE etc).

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.setDisplayRect(0, 0, 1920, 1080);
	}
	catch (e)
	{
	  console.log(e);
	}

play

Starts stream playback, or resumes stream playback after pause.

Product : TV, AV_BD, B2B (LFD)

Constraint

  • Can be called in the following states: «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.play();
	} 
	catch (e) 
	{
	console.log(e);
	}

Adaptive streaming using TS container (for e.g. HLS) with audio sample rate changing across variants may cause audio loss.

seekTo

Skips playback to a specific timestamp.
For HTTP streaming, this method is successful even when the specified timestamp is invalid. The internal player automatically resets an out-of-range value to an in-range one.


void seekTo(long milliseconds, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • milliseconds: Timestamp to skip to
  • successCallback: Callback method to invoke when the call is successful
  • errorCallback: Callback method to invoke when an error occurs

Constraint

  • Can be called in the following states: «IDLE»,»READY», «PLAYING» (buffered data is flushed and buffering starts over), «PAUSED».
    During this async operation, the other API would not be allowed. So, the application needs to wait for one of both callbacks( SuccessCallback, errorCallback) before any other API call.
    For LIVE stream case, seek position must be within DVR range. DVR range could be retrieved using GET_LIVE_DURATION property in getStreamingProperty API.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.seekTo(10000,successCallback, errorCallback);
	}
	catch (e)
	{
		console.log(e);
	}
// for live cases, get the live duration as :
var StartTime = webapis.avplay.getStreamingProperty("GET_LIVE_DURATION").split('|')[0];
var EndTime = webapis.avplay.getStreamingProperty("GET_LIVE_DURATION").split('|')[1];
// seekpoint must be between StartTime and Endtime.
 

stop

Stops the player. Call this function after the video finishes playing.

Product : TV, AV_BD, B2B (LFD)

Constraint

  • Can be called in the following states: «NONE», «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.stop();
	} 
	catch (e) 
	{
	console.log(e);
	}

getState

Retrieves the current player state.


  AVPlayPlayerState getState();

Product : TV, AV_BD, B2B (LFD)

Return value:

AVPlayPlayerState «NONE», «IDLE», «READY», «PLAYING», «PAUSED».

Constraint

  • Can be called in the following states: «NONE», «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


var BRet = webapis.avplay.getState();

pause

Pauses playback. If this method is called successfully, current time updates are stopped.

Product : TV, AV_BD, B2B (LFD)

Constraint

  • Can be called in the following states: «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type InvalidAccessError, if this API couldn’t operate at the moment. (E.g. During the async operation such as seekTo, etc.)

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.pause();
	} 
	catch (e) 
	{
	console.log(e);
	}

jumpForward

Skips playback forward by a specific amount of time. The player state is unchanged.
Passing the optional callbacks is recommended. For best performance, ensure that the previous call to this API was successful.
For HTTP streaming, this method is successful even when the resulting timestamp is invalid. The internal player automatically resets an out-of-range value to an in-range one.


 void jumpForward(long milliseconds, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • milliseconds: Time to skip forward, in milliseconds
  • successCallback: Callback method to invoke when the call is successful
  • errorCallback: Callback method to invoke when an error occurs

Constraint

  • Can be called in the following states: «READY» (when using the synchronous prepare method), «PLAYING», «PAUSED»
    During this async operation, the other API would not be allowed. So, the application needs to wait for one of both callbacks( SuccessCallback, errorCallback) before any other API call.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.jumpForward(5000,  successCallback, errorCallback);

jumpBackward

Skips playback backward by a specific amount of time. The player state is unchanged.
For HTTP streaming, this method is successful even when the resulting timestamp is invalid. The internal player automatically resets an out-of-range value to an in-range one.


void jumpBackward( long milliseconds, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback );

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • milliseconds: Time to skip backward, in milliseconds
  • successCallback: Callback method to invoke when the call is successful
  • errorCallback: Callback method to invoke when an error occurs

Constraint

  • Can be called in the following states: «READY» (when using the synchronous prepare method), «PLAYING», «PAUSED»
    During this async operation, the other API would not be allowed. So, the application needs to wait for one of both callbacks( SuccessCallback, errorCallback) before any other API call.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.jumpBackward(5000,  successCallback, errorCallback); 

getDuration

Retrieves the total media duration.


unsigned long getDuration();

Product : TV, AV_BD, B2B (LFD)

Return value:

unsigned long number Duration, in milliseconds

Constraint

  • Can be called in the following states:»NONE», «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


duration = calcPlaytime(webapis.avplay.getDuration());

function calcPlaytime(totalMilisec) {
  var Hours = Math.floor(totalMilisec/3600000);
  var Minutes = Math.floor((totalMilisec - (Hours * 3600000)) / 60000);
  var Seconds = Math.floor((totalMilisec - (Hours * 3600000) - (Minutes * 60000)) / 1000);
  var Milisec = totalMilisec - (Hours * 3600000) - (Minutes * 60000) - (Seconds * 1000);
  return {
    Hours: Hours,
    Minutes: Minutes,
    Seconds: Seconds,
    milisec: Milisec,
    totalMilisec: totalMilisec
  }
}

getCurrentTime

Retrieves the current playback time.


unsigned long getCurrentTime();

Product : TV, AV_BD, B2B (LFD)

Return value:

unsigned long number Current playback time, in milliseconds.

Constraint

  • Can be called in the following states: «NONE», «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


var CurrentPlayTime = webapis.avplay.getCurrentTime();

setTimeoutForBuffering

Sets the stream buffering timeout. When the specified amount of time has passed, the onbufferingcomplete callback is invoked, irrespective of buffering progress.
If not set using this method, the default buffer size is 32MB or 10 seconds of playable data, and 20 seconds time-out.


void setTimeoutForBuffering(unsigned long seconds);

Product : TV, AV_BD, B2B (LFD)

Parameters

  • seconds: Buffering timeout duration, in seconds. Depending on network conditions, 3 to 10 seconds is recommended.

Constraint

  • Can be called in the following states: «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.setTimeoutForBuffering(10);

setBufferingParam

Sets the buffer size for the play and resume scenarios. The time buffer size must be at least 4 seconds.
For example, If a 10 second buffer size is set, playback can only start or resume after 10 seconds of media has accumulated in the buffer.
Play scenarios include user-initiated streaming playback and whenever media playback is starting for the first time.
Resume scenarios include resuming playback after pause or seek operations, or when lack of data causes playback rebuffering.


void setBufferingParam(AVPlayBufferOption option, AVPlayBufferSizeUnit unit, unsigned long amount);

Product : TV, AV_BD, B2B (LFD)

Parameters

  • option: «PLAYER_BUFFER_FOR_PLAY» or «PLAYER_BUFFER_FOR_RESUME»
  • unit: «PLAYER_BUFFER_SIZE_IN_SECOND»
  • amount: Data amount to be buffered, in bytes or seconds as specified by the unit parameter

Constraint

  • Can be called in the following states: «IDLE»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


// For the initial buffering
webapis.avplay.setBufferingParam("PLAYER_BUFFER_FOR_PLAY","PLAYER_BUFFER_SIZE_IN_SECOND", 5); // 5 is in seconds
// For the rebuffering
webapis.avplay. setBufferingParam("PLAYER_BUFFER_FOR_RESUME","PLAYER_BUFFER_SIZE_IN_SECOND", 15); // 15 is in seconds

unit «PLAYER_BUFFER_SIZE_IN_BYTE» has been deprecated from Tizen version 5.0

setSpeed

Sets the current playback rate. Positive parameter values play the media forwards, while negative values cause the media to play in reverse.
The range of valid playback rates depends on the streaming protocol. If the input parameter is out of range, the player returns the PLAYER_ERROR_INVALID_PARAMETER flag.


 void setSpeed(long playbackSpeed);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • playbackSpeed:  -16x, -8x, -4x, -2x, 1x, 2x, 4x, 8x, 16x

Constraint

  • Can be called in the following states: «READY, «PLAYING», «PAUSED»
    For the general HTTP and HTTPS, the supported playback rate is -8x ~ 8x. (Repeated seek) Please refer to the specification for the supported range of other streaming types.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


try {
	webapis.avplay.setSpeed(2);
	} 
	catch (e) 
	{
	console.log(e);
	}

setListener

Sets asynchronous callback methods for player information notifications, such as buffering progress, player information, playback mode, and DRM mode information.


void setListener(AVPlayPlaybackCallback playbackCallback);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • playbackCallback: AVPlayPlaybackCallback

Constraint

  • Can be called in the following states: «NONE», «IDLE» (recommended), «READY», «PLAYING», «PAUSED»
    To avoid missing necessary information, the onbufferingstart, onbufferingprogress, onbufferingcomplete, onerror, onevent, and ondrmevent listeners must be set during the «IDLE» state.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type UnknownError, for any other error.

Code example:


var Listener = {
	onbufferingstart: function() {
		console.log("Buffering start.");
		},
		onbufferingprogress: function(percent) {
			console.log("Buffering progress data : " + data1);
		},
		onbufferingcomplete: function() {
			console.log("Buffering complete.");
		},
		oncurrentplaytime: function(currentTime) {
			console.log("Current Playtime : " + data1);
		},
		onbufferingcomplete: function() {
			console.log("Buffering complete.");
		},
		onevent: function(eventType, eventData) {
			console.log("event type error : " + eventType + ", data: " + eventData);
		},
		onerror: function(eventType) {
			console.log("event type error : " + eventType);
		},
		onsubtitlechange: function(duration, text, data3, data4) {
			console.log("Subtitle Changed.");
		},
		ondrmevent: function(drmEvent, drmData) {
			console.log("DRM callback: " + drmEvent + ", data: " + drmData);
		},
		onstreamcompleted: function() {
			console.log("Stream Completed");
		}
	}
webapis.avplay.setListener(Listener);

setDrm

Updates the DRM information, such as SetProperties . You can change the DRM mode and run the control feature. The AVPlayDrmOperation and jsonParam parameters depend on the DRM type. Please refer to the specification and MSE/EME for the supported DRM.


DOMString setDrm(AVPlayDrmType drmType, AVPlayDrmOperation drmOperation, DOMString jsonParam);

Product : TV, AV_BD, B2B (LFD)

Privilege level: Public

Privilege: http://developer.samsung.com/privilege/drmplay

Parameters

  • drmType: AVPlayDrmType {«PLAYREADY», «VERIMATRIX», «WIDEVINE_CDM»}
  • drmOperation: String specifying the DRM operation to be performed. The valid values are depending on the DRM Types. This is mainly used for setting DRM information, such as the license server, application-specific custom data, SOAP or HTTP header, the genChallenge mode, and license usage.
  • jsonParam: DOMString DRM parameter represented by JSON string. You can use the JSON.stringify method to generate the JSON string.

Constraint

  • Can be called in the following states: «IDLE»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type SecurityError, if the application does not have the privilege to call this method.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.
      Examples of exception scenarios include an invalid DRM session, or failure to create the underlying DRM module or configuration. In these scenarios, an exception is thrown and the method call returns FALSE.

Code example:


			// Implementing DRM support
// 1. PlayReady example: Setting license server and custom data
// 1.1 PlayReady with GenChallenge
var Listener = 
	{
		ondrmevent: function(drmType, drmData)
		{
			if(drmData.name === 'Challenge')
			{
				// take drmData.challenge to obtain license data.
			}
		}
	}
webapis.avplay.setListener(Listener);
var appdata={DeleteLicenseAfterUse:true,GetChallenge:true,"LicenseServer":"http://license.company.com", "CustomData":"mycustom}
webapis.avplay.setDrm("PLAYREADY", "SetProperties", JSON.stringify(appdata));

// The avplay will configure and provide challenged data through ondrmevent() callback.
// Once challenge data is received, the application should first decode challenge data using base64, and obtain license from the license server.
var license_data;// After obtaining license data, encode it using base64 and save into this 'license_data'.
webapis.avplay.setDrm("PLAYREADY", "InstallLicense", license_data);

// 1.2. PlayReady without GenChallenge
var appdata={"DeleteLicenseAfterUse":true, "LicenseServer":"http://license.company.com", "CustomData":"mycustom"}
webapis.avplay.setDrm("PLAYREADY", "SetProperties", JSON.stringify(appdata));

// 2. Verimatrix example: Initializing Verimatrix DRM
// Application should call GetUID only once and save it for further use, after every open API GetUID need not be called.
if (true)
{ 
	// Since Tizen version 5.0
	DOMString Verimatrix_UID = webapis.avplay.getUID("VERIMATRIX");
} 
else 
{
	// Before Tizen version 5.0
	webapis.avplay.setDrm( "VERIMATRIX", "GetUID", "");
}

// After open application should follow following sequence
var DrmParam = {}
DrmParam.CompanyName ="MyCompany";
DrmParam.IPTV="public2.verimatrix.com";
DrmParam.Web="public-ott-nodrm.verimatrix.com:80";
if (true) 
{
	// Since Tizen version 5.0
	webapis.avplay.setDrm( "VERIMATRIX", "SetProperties", JSON.stringify(DrmParam));
} 
else 
{ 
	// Before Tizen version 5.0
	webapis.avplay.setDrm( "VERIMATRIX", "Initialize", JSON.stringify(DrmParam));
}

// 3. Widevine Modular example
var sessionId;
var Listener = 
{
	ondrmevent: function(drmType, drmData) 
	{
		if(drmData.name === 'Challenge') 
		{
			sessionId = drmData.session_id;
			// take drmData.challenge and drmData.serverurl to obtain license data.
		}
	}
}
webapis.avplay.setListener(Listener);
var DrmParam = {}

// Sample session value; App must set there own session id.
DrmParam.AppSession = "test-session";
DrmParam.DataType = "MPEG-DASH";
if (true) 
{
	// Since Tizen version 5.0
	webapis.avplay.setDrm("WIDEVINE_CDM", "SetProperties", JSON.stringify(DrmParam));
} 
else 
{
	// Before Tizen version 5.0
	webapis.avplay.setDrm("WIDEVINE_CDM", "Initialize", "");
	webapis.avplay.setDrm("WIDEVINE_CDM", "widevine_app_session", DrmParam.AppSession);
	webapis.avplay.setDrm("WIDEVINE_CDM", "widevine_data_type", DrmParam.DataType);
}

// The avplay will configure and provide challenged data and session id through ondrmevent() callback.
// Once challenge data is received, the application should first decode challenge data using base64, and obtain license from the license server.
var license_data;// After obtaining license data, encode it using base64 and save into this 'license_data'.
var LicenseParam = sessionId + "PARAM_START_POSITION" + license_data + "PARAM_START_POSITION";
webapis.avplay.setDrm("WIDEVINE_CDM", "widevine_license_data", LicenseParam);

‘GetUID’ operation has been deprecated from Tizen version 5.0, rather application should use getUID() API.
‘Initialize’ and ‘Finalize’ operations have been deprecated from Tizen version 5.0. Because these are being executed by avplay itself.
‘widevine_app_session’ and ‘widevine_data_type’ operations have been deprecated from Tizen version 5.0. Because these are merged into «SetProperties». Please refer to setDrm() example.

getUID

Gets the device UID. The input would be the drm type.


			DOMString getUID(AVPlayDrmType drmType);
			

Product : TV, AV_BD, B2B (LFD)

Parameters :

  • drmType: AVPlayDrmType {«VERIMATRIX»} // only VERIMATRIX is supported AVPlayDrmType for getUID interface.

Constraint

  • Can be called in the following states: «NONE», «IDLE», «READY», «PLAYING», «PAUSED».

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type SecurityError, if the application does not have the privilege to call this method.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


 			var verimatrixUID = webapis.avplay.getUID("VERIMATRIX"); //Verimatrix example: Retrieving the Verimatrix UID

setSoundAnalysisListener

Retrieves the audio spectrum analysis result every 30 ms. You can use it for an equalizer effect video or in a PartyTV application. The spectrum is analyzed across an array of 31 bands, of which Bands[14] ~ Bands[18] generally have the largest values.


			void setSoundAnalysisListener(AVPlaySoundAnalysisCallback soundAnalysisCallback);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • soundAnalysisCallback: AVPlaySoundAnalysisCallback

Constraint

  • Can be called in the following states: «IDLE»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


  		webapis.avplay.setSoundAnalysisListener(soundAnalysisListener);
function soundAnalysisListener(dataArray) 
	{
		// Listener registered to and receiving data from AVPlay
		var BarHeight = 0;		 
		var AbsValue = 0;		 
		var Threshold = 70;		 
		for (var I = 0; I < dataArray.length; I++)
			{
			AbsValue = Math.abs(dataArray[I]);		 
			if (AbsValue > Threshold)
				{
					BarHeight = Main.barContainerHeight;
				}
			else
				{		 
					BarHeight = Math.round((AbsValue/Threshold) * Main.barContainerHeight);		 
				}		 
			if (BarHeight == 0) BarHeight = 1;
				{
					document.getElementById('frequencyBar' + I).style.height = BarHeight + 'px';		 
				}		 
		console.log("Sound analysis: " + dataArray.toString());
			}
	}

unsetSoundAnalysisListener

Unregisters the sound analysis listener.


			void unsetSoundAnalysisListener();

Product : TV, AV_BD, B2B (LFD)

Constraint

  • Can be called in the following states: «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.unsetSoundAnalysisListener();

setSilentSubtitle

Enables or disables external subtitles.


void setSilentSubtitle(boolean onoff);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • onoff: Boolean value:
    • true: Subtitles are hidden
    • false: Subtitles are shown. The application does not receive any subtitle-related events.

Constraint

  • Can be called in the following states: «IDLE», «READY» (when using the synchronous prepare method), «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.setSilentSubtitle(true);

setExternalSubtitlePath

Sets the local path for the external subtitle file. Only absolute local paths are supported. If the subtitle file is stored remotely, you must first download the file to local storage, and pass the absolute local path.


void setExternalSubtitlePath(DOMString filePath);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • filePath: Absolute local path

Constraint

  • Can be called in the following states: «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.setExternalSubtitlePath(uri);

setSubtitlePosition

Adjusts external subtitle synchronization with the audio and video.


void setSubtitlePosition(long position);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • position: Time delay in milliseconds. The duration can be a positive or negative number; a positive delay displays the subtitles later, while a negative delay displays the subtitles sooner.

Constraint

  • Can be called in the following states: «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.setSubtitlePosition(position_millisec);

setDisplayMethod

Sets the video screen mode in the specified display area.


void setDisplayMethod(AVPlayDisplayMode displayMode);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • displayMode: «PLAYER_DISPLAY_MODE_LETTER_BOX», «PLAYER_DISPLAY_MODE_FULL_SCREEN», or «PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO»

Constraint

  • Can be called in the following states: «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


webapis.avplay.setDisplayMethod("PLAYER_DISPLAY_MODE_FULL_SCREEN");

setSelectTrack

Switches audio or subtitle tracks during playback.


void setSelectTrack(AVPlayStreamType trackType, long trackIndex);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • trackType: «AUDIO» or «TEXT»
  • trackIndex: AVPlayStreamInfo index

Constraint

  • Can be called in the following states: «READY» (for Smooth Streaming only), «PLAYING», «PAUSED» (for TEXT tracks only)
    If buffering is not complete, calling this method for an AUDIO track returns an error.
    The trackType «TEXT» is not supported for DASH streaming.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


var totalTrackInfo = webapis.avplay.getTotalTrackInfo();
for (var i=0; i < totalTrackInfo.length; i++) 
	{
	if(totalTrackInfo.type == 'TEXT') 
		{
			console.log('Find subtitle track.');
			console.log('subtitle track index is ' + totalTrackInfo.index);
			console.log('subtitle track language is ' + totalTrackInfo.extra_info.track_lang);
		}
	}
	
// Choose subtitle track index 2
webapis.avplay.setSelectTrack('TEXT',2);

Since tizen version 5.0, the trackType «AUDIO» is supported for DASH streaming.

getCurrentStreamInfo

Retrieves the currently-playing video, audio, or subtitle stream information, and notifies that a stream is playing.


AVPlayCurrentStreamInfo getCurrentStreamInfo();

Product : TV, AV_BD, B2B (LFD)

Return value:

AVPlayStreamInfo structure containing tracktype, extraInfo and index for the current stream

Constraint

  • Can be called in the following states: «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


var StreamInfo = webapis.avplay.getCurrentStreamInfo();
var Text = '';
for (var I = 0; I < StreamInfo.length; I++) 
{
  Text += 'index: ' + StreamInfo[I].index + '';
  Text += 'type: ' + StreamInfo[I].type + '';
  Text += 'extra_info: ' + StreamInfo[I].extra_info + '';
}
//All streams have extra_info as a JSONString.
//video extra_info example : "{fourCC:"H264","Width":"1920","Height":"1080","Bit_rate":" 477000"}"
//audio extra_info example : "{"language":"eng","channels":"2","sample_rate":"44100","bit_rate":"96000","fourCC":"AACL"}"
//text(subtitle) extra_info example : "{"track_num":"0","track_lang":"eng","subtitle_type":"-1","fourCC":"TTML"}"
//If the stream is invalid, the DOMString is null and the index value is -1.

For the adaptive streaming such as HLS, DASH and SmoothStreaming, the ‘language’ is same as what represented on given manifest file.

getTotalTrackInfo

Retrieves the currently-playing stream information.


AVPlayStreamInfo[] getTotalTrackInfo();

Product : TV, AV_BD, B2B (LFD)

Return value:

AVPlayStreamInfo[] structure containing tracktype, extraInfo and Index of current stream
Returns information for the all available tracks in the stream. The information is returned in the following structure:
For video tracks: «{«fourCC»:»%s»,»Width»:»%u»,»Height»:»%u»,»Bit_rate»:»%u»}»
For audio track: «{«language»:»%s»,»channels»:»%d»,»sample_rate»:»%d»,»bit_rate»:»%d»,»fourCC»:»%s»}»
For subtitle tracks: «{«track_num»:»%d»,»track_lang»:»%s»,»subtitle_type»:»%d»,»fourCC»:»%s»}»
Some of them are not constant value(E.g. Video:Width, Height, and Bit_rate, Audio:channels, sample_rate, and bit_rate) for adaptive streaming such as HLS, DASH and SmoothStreaming.

Constraint

  • Can be called in the following states: «READY» (when using the synchronous prepare method), «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


var TrackInfo = webapis.avplay.getTotalTrackInfo();
var Text = 'type of track info: ' + typeof TrackInfo + '';
Text += 'length: ' + TrackInfo.length + '';
for (var I = 0; I < TrackInfo.length; I++) 
{
  Text += 'index: ' + TrackInfo[I].index + '';
  Text += 'type: ' + TrackInfo[I].type + '';
  Text += 'extra_info: ' + TrackInfo[I].extra_info + '';
}

For the adaptive streaming such as HLS, DASH and SmoothStreaming, the ‘language’ is same as what represented on given manifest file.

setStreamingProperty

Sets specific feature values for HTTP, MMS, or specific streaming engine (Smooth Streaming, HLS, DASH, DivX Plus Streaming, or Widevine). The available streaming properties depend on the streaming protocol or engine.
Use the CUSTOM_MESSAGE property for streaming engine or CP-specific settings.


void setStreamingProperty(AVPlayStreamingPropertyType propertyType, DOMString propertyParam);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • propertyType: { «COOKIE», «USER_AGENT», «PREBUFFER_MODE» , «ADAPTIVE_INFO», «SET_MODE_4K», «PROPERTY_HD_AUDIO», «LISTEN_SPARSE_TRACK»,»WIDEVINE» };
  • propertyParam: Value according to the propertyType. e.g. «ADAPTIVE_INFO» PropetyTypes are «BITRATES», «STARTBITRATE», «SKIPBITRATE», «FIXED_MAX_RESOLUTION».

Constraint

  • Can be called in the following states: «IDLE»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


//Smooth Streaming example:
var BitRateString = "BITRATES=5000~10000|STARTBITRATE=HIGHEST|SKIPBITRATE=LOWEST"; webapis.avplay.setStreamingProperty("ADAPTIVE_INFO", BitRateString);

//Prebuffer mode example:
webapis.avplay.setStreamingProperty("PREBUFFER_MODE", time_in_miliseconds);

Player1 => Playback of Main Content
Player2 => Playback of advertisement (Buffered the ad content before playback).
Player1 = webapis.avplaystore.getPlayer();
Player2 = webapis.avplaystore.getPlayer();
Player1.open('http://www.example.com/example_1.mp4');
Player1.setDisplayRect(x, y, width, height);
Player1.prepare();
Player1.play();
Player2.open('http://www.example.com/example_2.mp4');
Player2.setStreamingProperty("PREBUFFER_MODE", "5000");
Player2.setDisplayRect(x, y, width, height);
Player2.prepare();
Player1.stop();
Player2.play();

//User-agent example:
webapis.avplay.setStreamingProperty("USERAGENT", "samsungsmooth-agent/1.1");

//Setting resolution information for HLS/DASH
webapis.avplay.setStreamingProperty("ADAPTIVE_INFO", "FIXED_MAX_RESOLUTION=7680X4320");


«WIDEVINE» unit has been deprecated from Tizen version 4.0
«PROPERTY_HD_AUDIO» unit has been deprecated from Tizen version 2.4

getStreamingProperty

Retrieves a specific property value obtained by the streaming engine (Smooth Streaming, HLS, DASH, or Widevine).


DOMString getStreamingProperty(AVPlayStreamingPropertyType propertyType);

Product : TV, AV_BD, B2B (LFD)

Parameters:

  • propertyType: AVPlayStreamingPropertyType { «IS_LIVE», «AVAILABLE_BITRATE», «GET_LIVE_DURATION»,»CURRENT_BANDWIDTH»};

Return value:

DOMString Property value

Constraint

  • Can be called in the following states: «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


var Text = 'AVAILABLE_BITRATE: ' + webapis.avplay.getStreamingProperty ("AVAILABLE_BITRATE") ;
 Text += 'CURRENT_BANDWIDTH: ' + webapis.avplay.getStreamingProperty ("CURRENT_BANDWIDTH") + '';
 Text += 'IS_LIVE: ' + webapis.avplay.getStreamingProperty ("IS_LIVE") +'';

@endparblock @code
 var StartTime = webapis.avplay.getStreamingProperty("GET_LIVE_DURATION").split('|')[0];
 var EndTime = webapis.avplay.getStreamingProperty("GET_LIVE_DURATION").split('|')[1];

 if (StartTime > targetSeekTime)
 { 
     if (EndTime < targetSeekTime)
    {
        webapis.avplay.seekTo(targetSeekTime); //ms
    }
  }

GET_SERVER_TIME_SCALE and GET_ABSOLUTE_SERVER_TIME: Supported for Smooth Streaming only.

getVersion

Retrieves the AVPlay version.

Product : TV, AV_BD, B2B (LFD)

Return value:

DOMString string current version

Constraint

  • Can be called in the following states: «NONE», «IDLE», «READY», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


var Version = webapis.avplay.getVersion();

suspend

Pauses the player state when the application is sent to the background. Saves the current statistics for the ongoing playback session.

Product : TV, AV_BD, B2B (LFD)

Constraint

  • Can be called in the following states: «READY, «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


document.addEventListener("visibilitychange", function() 
{
  if(document.hidden)
  {
    // Something you want to do when application is paused.
    console.log("lifecycle [pause]");
    webapis.avplay.suspend();
  } 
  else 
  {
    // Something you want to do when application is resumed.
    console.log("lifecycle [resume]");
    webapis.avplay.restore();
  }
});

restore

During multitasking, restores the player state when the application is resumed. For live streaming or DRM-encrypted content playback, you must check whether the streaming URL has changed or the DRM session or license has expired, and specify the new URL and DRM information as needed.


void restore(DOMString URL, optional unsigned long? resumeTime, optional boolean? bPrepare);

Product : TV, AV_BD, B2B (LFD)

Parameters

  • URL: updated URL after suspend. If null, the stored URL is used.
    For live streaming or DRM-encrypted content playback, in case the URL has changed or the DRM license or session has expired, checking for and passing the newest URL is recommended.
  • resumeTime: (milliseconds) Optional. Position from which to resume playback. If 0, the stored position is used.
    For live streaming, this parameter is not meaningful. Do not pass 0 for this parameter.
    For DRM-encrypted content playback, if the DRM session has expired, to recreate the playback pipeline, pass 0 for this parameter.
  • bPrepare: Optional boolean. false (default): Player sets the resume behavior automatically. true: Player does not resume automatically. The application must invoke the prepare and play methods.
    For live streaming, this parameter is not meaningful. Do not pass true for this parameter.
    For DRM-encrypted content playback: if the DRM session has expired, pass true for this parameter.

Constraint

  • Can be called in the following states: «NONE», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


document.addEventListener("visibilitychange", function() 
{
  if(document.hidden)
  {
    // Something you want to do when application is paused
    console.log("lifecycle [pause]");
    webapis.avplay.suspend();
  }
  else
  {
    // Something you want to do when application is resumed
    console.log("lifecycle [resume]");
    webapis.avplay.restore(url, 0, false);
  }
});

restoreAsync

During multitasking, restores the player state when the application is resumed.restoreAsync is an asynchronous interface.
Other API, restore is a synchronous interface which blocks the application thread. This method is preferred over restore because it returns immediately and does not block the application thread during its restoration.
When player is restored successful, the success callback is returned and player resumed the playback from the restored playback position, state, properties etc. If restoration fails, the error callback returns the error value.
Application is required to make further calls to avplay on its success or failure callback happens.
For live streaming or DRM-encrypted content playback, you must check whether the streaming URL has changed or the DRM session or license has expired, and specify the new URL and DRM information as needed.


void restoreAsync(DOMString URL, optional unsigned long? resumeTime, optioanl boolean? bPrepare, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);

Product : TV, AV_BD, B2B (LFD)

Parameters

  • URL: updated URL after suspend. If null, the stored URL is used.
    For live streaming or DRM-encrypted content playback, in case the URL has changed or the DRM license or session has expired, checking for and passing the newest URL is recommended.
  • resumeTime: (milliseconds) Optional. Position from which to resume playback. If 0, the stored position is used. For live streaming, this parameter is not meaningful. Do not pass 0 for this parameter. For DRM-encrypted content playback, if the DRM session has expired, to recreate the playback pipeline, pass 0 for this parameter.
  • bPrepare: Optional boolean. false (default): Player sets the resume behavior automatically. true: Player does not resume automatically. The application must invoke the prepare and play methods.
    For live streaming, this parameter is not meaningful. Do not pass true for this parameter.
    For DRM-encrypted content playback: if the DRM session has expired, pass true for this parameter.
  • successCallback: Callback method to invoke when the call is successful
  • errorCallback: Callback method to invoke when an error occurs

Constraint

  • Can be called in the following states: «NONE», «PLAYING», «PAUSED»

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

    • with error type NotSupportedError, if this feature is not supported.

    • with error type InvalidValuesError, if any input parameter contains an invalid value.

    • with error type InvalidStateError, if it is called in an invalid state.

    • with error type UnknownError, for any other error.

Code example:


document.addEventListener("visibilitychange", function() 
{
	if(document.hidden)
	{
		// Something you want to do when application is paused
		console.log("lifecycle [pause]");
		webapis.avplay.suspend();
	}
	else 
	{
		// Something you want to do when application is resumed
		console.log("lifecycle [resume]");
		try 
		{
			var successCallback = function()
			{
			console.log("success");
			}
			var errorCallback = function(err)
			{
			throw new Error('Error:' + err.name);
			}
			webapis.avplay.restoreAsync(url, 0, false, successCallback, errorCallback);
		} 
		catch (e) 
		{
			console.log(e);
		}
	}
});

2.3. AVPlayPlaybackCallback

Defines callbacks for buffering and playback notifications.


[Callback=FunctionOnly, NoInterfaceObject] interface AVPlayPlaybackCallback{
  void onbufferingstart();
  void onbufferingprogress(unsigned long percent);
  void onbufferingcomplete();
  void oncurrentplaytime(unsigned long currentTime );
  void onstreamcompleted();
  void onevent(AVPlayEvent eventid, DOMString data );
  void onerror(AVPlayError eventid);
  void ondrmevent(AVPlayDrmType type, drmData data);
  void onsubtitlechange(unsigned long duration, DOMString subtitles, unsigned long type, AVPlaySubtitleAttribute attributes);
};

Methods

onbufferingstart

Callback method for asynchronous buffering started notifications.

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


onbufferingstart: function() 
{
  console.log("Buffering start.");
}

onbufferingprogress

Callback method for asynchronous buffering progress notifications.


void onbufferingprogress(unsigned long percent);

Parameters:

  • percent: unsigned long

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


onbufferingprogress: function(percent) 
{
  console.log("Buffering progress data : " + percent);
}

onbufferingcomplete

Callback method for asynchronous buffering complete notifications.


void onbufferingcomplete();

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


onbufferingcomplete: function()
{
  console.log("Buffering complete.");
}

oncurrentplaytime

Callback method for the current playback time.


void oncurrentplaytime(unsigned long currentTime );

Parameters:

  • currentTime: unsigned long

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


oncurrentplaytime: function(currentTime)
{
  console.log("Current playtime: " + currentTime);
}

onstreamcompleted

Callback method for asynchronous playback finished notifications.


void onstreamcompleted();

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


onstreamcompleted: function(currentTime)
{
  console.log("Stream Completed");
}

onevent

Callback method for asynchronous event notifications.


void onevent(AVPlayEvent eventid, DOMString data );

Parameters:

  • eventid: AVPlayEvent object
  • data: DOMString

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


onevent: function(eventType, eventData)
{
  console.log("OnEvent Callback with eventType: " + eventType);
}

onerror

Callback method for AVPlay error notifications.


void onerror(AVPlayError eventid);

Parameters:

  • eventid: AVPlayError object

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


onerror: function(eventType)
{
  console.log("OnError Event Callback with eventType: " + eventType);
}

ondrmevent

Callback method for DRM information notifications.


void ondrmevent(AVPlayDrmType type, drmData data);

Parameters:

  • type: AVPlayDrmType object
  • data: drmData

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


ondrmevent: function(drmType, drmData) 
{
 console.log("DRM callback, type: " + drmType + ", data: " + drmData);
 if(drmData.name === 'Challenge')
 {
	var ChallengeData = 
	{
	"NAME": drmData.name,
	"SESSION_ID": drmData.session_id,
	"CHALLENGE": drmData.challenge,
	"CHALLENGE_LEN": drmData.challenge_len,
	"SERV_URL": drmData.serverurl,
	"SERV_URL_LEN": drmData.serverurl_len
	} 
	// Use challenge data to get drm license.
 } 
 else if (drmData.name === 'DrmError') 
 {
	 var ErrorInfo = 
	 {
		 "NAME": drmData.name,
		 "ERROR_CODE": drmData.code,
		 "ERROR_MESSAGE": drmData.message // Generally, it's human readable message.
	}
 }
}

onsubtitlechange

Callback method for asynchronous subtitle change notifications.


void onsubtitlechange(unsigned long duration, DOMString subtitles, unsigned long type, AVPlaySubtitleAttribute attributes);

Parameters:

  • duration: unsigned long
  • subtitles: DOMString
  • type: unsigned long
  • attriCount: unsigned long
  • attributes: AVPlaySubtitleAttribute «attr_type»: «AttributeType:value»; «start_pos»: start position as long; «stop_pos»: stop position as long

Exceptions:

  • WebAPIException
    • with error type NotSupportedError, if this feature is not supported.

    • with error type UnknownError, for any other error.

Code example:


onsubtitlechange: function(duration, text, data3, data4)
{
  console.log("Subtitle Changed.");
}

If you’re playing Minecraft with mods installed, you may encounter the infamous “OpenGL Error 1282” bug, which spams itself in your chat and even turns your entire screen black in some cases.

How to fix OpenGL 1282 Error in Minecraft

This may seem like a very serious bug, but don’t be alarmed, as it can be quite easy to fix once you figure out what you’re dealing with. There can be several reasons why you’re experiencing this error in Minecraft. You have to figure out the exact root cause of this problem and what you can do to solve it. 

So below, we’ve compiled a list of all the possible causes of the OpenGL 1282 Error in Minecraft.

  • Missing .dll File: DLL files are special files used by programs to execute their required operations. If you’re missing a DLL file, it can cause programs to malfunction. One of the possible causes of OpenGL Error 1282 is a missing DLL file named opengl32.dll. 
  • Shaders: Shaders are known to be troublemakers in Minecraft, especially if you have mods installed. They use a great number of your system’s resources and tend to conflict with the mods you’ve installed, causing errors.
  • Incompatible Mods: Each Minecraft mod is designed to work with a specific game version. Trying to run the mod on a different version will cause many issues.
  • Outdated Java: Java is required by Minecraft and its third-party mod installers to be able to run. Outdated versions of Java can hinder the game’s performance and cause bugs.
  • Outdated Optifine: Outdated versions of Optifine are a major cause of OpenGL Errors in Minecraft. 
  • Outdated Graphics Drivers: If you haven’t updated your GPU drivers in a while, they can cause issues, especially if you’re trying to play with newer mods.

1. Disable the Show GL Errors Option

There are two types of OpenGL Error 1282 bug in Minecraft. In the first type, the bug just spams a message in your game chat that says “OpenGL Error: 1282 (Invalid operation)“.

In the second type, not only does the bug spam this message in your chat, but it also makes your screen completely black. 

If you’re experiencing the first type of this bug, where it only shows up in your chat, and the rest of your game works fine, there’s a very simple solution to your problem.

All you need to do to fix this type of OpenGL error is to disable the “Show GL Errors” options from the in-game menu of Minecraft. To disable this option, follow the steps we’ve listed below:

  1. Open Minecraft and head into your world. 
  2. Once you’ve loaded in, press Escape on your keyboard.
  3. Click on “Options…” in the menu.
    Going into Minecraft options
  4. Click on “Video Settings…”
    Opening Minecraft Video Settings
  5. Click on “Other…”
    Click on Others
  6. Click on the “Show GL Errors” option to disable it. 
    Disabling the OpenGL Error Notifications
  7. Click on Done. 

This method will turn off the chat notifications for the OpenGL Errors, instantly fixing your problem!

Now, if you’re experiencing the second type of the OpenGL Error 1282 bug, which turns your screen black, try the solutions we’ve listed below.

2. Download the Missing DLL File

Each program you download to your PC needs a set of DLL (Dynamic Library Link) files to function properly. These DLL files contain instructions, and programs like Minecraft use them to perform their required operations. 

For a program to be able to work as intended, it needs all of its required DLL files. 

So the first fix to the OpenGL Error 1282 bug will be to download a specific DLL file named opengl32.dll. You have to download this file and paste it into your Minecraft folder. This will likely fix your issue.

To download this missing DLL file, follow the steps listed below:

  1. Head to this website and download the opengl32.dll file by clicking on the orange download button. 
  2. If you have a 32-bit processor, download the 32-bit file; if you have a 64-bit processor, download the 64-bit file.
    Downloading the missing DLL file
  3. Extract the ZIP file into an empty folder.
  4. Copy the opengl32.dll file.
    Copying the opengl32.dll file
  5. Open File Explorer and paste the following address in the address bar:
    C:Program FilesJava
  6. Press enter and then open the JRE folder.
    Opening the Java folder
  7. Open the bin folder and paste the opengl32.dll file in there.
    Opening the bin folder
  8. Launch Minecraft and see if the error is fixed.

If you don’t know what type of processor you have, there’s no need to worry. You can easily determine whether you have a 32 or 64-bit processor within a few clicks of your mouse.

Go to your desktop and right-click on the “This PC” icon. Select Properties and then look at the System Type to determine your processor’s architecture (type).

Going into Properties of This PC

If it says 32-bit processor, return to the website linked above and download the “Architecture: 32” file. And if it’s a 64-bit processor, download the “Architecture: 64” file.

Checking the specifications of your processor

3. Disable Your Shaders

Shaders are used to change Minecraft’s entire look completely, but this comes at a cost. Shaders are known to cause all types of problems in Minecraft.

They consume a hefty amount of your system’s resources, causing game performance issues. But if Optifine and/or mods are installed, Shaders can conflict with them and create problems, such as OpenGL errors.

So if you have Shaders installed and are experiencing the OpenGL Error 1282 bug, make sure to disable the Shaders before you try other troubleshooting methods. These Shaders may just be the root cause of this error.

4. Check the Compatability of Your Mods

Whenever a developer makes a mod for Minecraft, they design it to run on a specific game version and the mod launcher (Forge). So if you try to run a mod on a game version and/or mod launcher it’s not designed for, it will cause many issues.

Therefore, whenever you download a mod, remember to check what game and mod launcher version it is compatible with. On the download page for the mod, there will be information regarding its compatibility.

Checking the compatibility of the mod

And on top of that, not all mods work together flawlessly. If you download a bunch of mods made by different developers, there’s a chance that they will conflict with each other and create errors.

If this happens, you can solve the issue by uninstalling all your mods and then reinstalling them. Each time you install a new mod, run the game and see if there are any errors.

As soon as you encounter an error, it’ll mean that the last mod you installed conflicts with the rest. You can either uninstall that mod or find a different version of it. If it continues to cause problems, keep it uninstalled. 

To avoid this hassle altogether, you should try using modpacks instead. Modpacks are filled with dozens of mods that have been carefully picked out by their creators. These modpacks are designed to work flawlessly. 

5. Update Java

You must keep Java updated if you’re playing the Java Edition of Minecraft. We know how annoying the constant Java update reminders can get, but it’ll only take a few minutes of your time to update it.

To update Java, follow the steps we’ve listed below:

  1. Press Windows Key and type Java in the search bar.
  2. Click on “Check for Updates”
    Checking for Java Updates
  3. In the Java Window that opens up, click on Update Now.
    Updating Java
  4. Click on Update.
    Update Java
  5. Allow Java SE Runtime Environment to make changes to your PC.
  6. Click on Install.
    Installing Java

After Java is done installing, relaunch Minecraft and see if your problem is resolved. If it isn’t, continue with the solutions listed below.

6. Update Optifine (If Applicable)

Updates for Optifine are released quite often, so many players forget to keep downloading all of its updates. 

If you don’t keep your Optifine up to date, it’s a big mistake. An outdated version of Optifine can cause errors, especially if you’re using other mods. 

So make sure to update your Optifine from time to time. If you don’t remember how to, first close Minecraft and then follow the steps listed below:

  1. Head to the official Optifine website and download the latest version of Optifine.
    Downloading Optifine
  2. After it finishes downloading, open up the file.
  3. Click on Install.
    Installing Optifine
  4. After it’s done installing, open up your Minecraft launcher and select the latest Optifine profile before pressing play.
    Selecting the Optifine profile

7. Update Your Graphics Card Drivers

If none of the above solutions have worked for you, then the next step to fixing is to update your Graphics Card (GPU) drivers.

Unless you have a super old GPU, your GPU’s manufacturer is likely still releasing driver updates for it. You must regularly install these driver updates to ensure your GPU performs at its highest potential.

Now, to update your GPU drivers, you must first determine your GPU’s exact brand and model. To figure this out, follow the steps we’ve listed down below:

  1. Right-click on the Windows icon at the bottom-left corner of your screen.
  2. Select Device Manager.
    Opening Device Manager
  3. Click on the arrow next to Display Adapters to expand it.
  4. Note down the name of the GPU that appears.
    Identifying GPU model using Device Manager

Unless your GPU drivers are corrupted or completely missing, this method should allow you to determine your GPU’s exact model.

But if it simply says, “Microsoft Basic Display Adapter,” instead of showing any unique model/brand name, then it means that GPU drivers are, in fact, corrupt/missing.

In this case, you’ll need to find your GPU’s model through another method. Follow the steps listed below:

  1. Right-click on the Windows icon at the bottom-left corner of your screen.
  2. Select Device Manager.
    Opening Device Manager
  3. Click on the arrow next to Display Adapters to expand it.
  4. Right-click on the Microsoft Basic Display Adapter.
  5. Click on Properties.
    Selecting GPU Properties
  6. In the Properties Window, navigate to the Details tab.
  7. Open up the drop-down list under Property.
  8. Select Hardware Ids.
    Selecting Hardware Ids
  9. Right-click on the first line of text written under Value.
  10. Click on Copy.
    Copying Hardware Id
  11. Open your browser, paste this text line into the search bar, and press enter.

When you press enter, the top results on Google will have your GPU’s exact brand and model written in their title, allowing you to easily figure out what GPU you’re working with.

Finding the name of GPU through Google

Since we now know the name of your Graphics Card, we can start searching for its drivers online. But before we do that, we have to uninstall the GPU drivers that are currently installed in your system.

To do this, we’ll use a program called “Display Driver Uninstaller.” This program is far superior to the native Windows driver uninstaller.

This is because the Windows driver uninstaller does not delete the drivers well. It tends to miss out on some files, leaving residue behind. These residue files can cause problems when you update the drivers. 

So to ensure that the current drivers are completely wiped from your system, we’ll be using DDU. 

After you’ve downloaded and installed DDU, we have to ensure the safest driver removal process by booting the PC in Safe Mode. 

  1. Press Windows Key and click on the Power button.
  2. Hold the shift key on your keyboard and click on the Restart option.
  3. Select Troubleshoot.
  4. Head to Advanced Options and then select Startup Settings. 
  5. Enter Safe Mode by pressing the F5 key on your keyboard.
    Going into Advanced Options
    Selecting Startup Settings
    Entering Safe Mode

Now that your PC is in Safe Mode, we can begin the driver removal process. Launch the Display Driver Uninstaller app, select “GPU” as your device type, and then select the brand of your GPU.

Click on the “Clean and restart” option to start wiping your GPU’s drivers.

Removing GPU drivers using DDU

After the drivers are completely wiped, the next step is to download the latest drivers of your GPU. 

But before we do that, keep in mind that installing the latest version of GPU drivers can sometimes cause problems if your system is a laptop.

The drivers provided by your laptop’s Original Equipment Manufacturer (OEM) perform the best with your system. So it’s better to use the drivers provided by the OEM instead of just installing the latest drivers. 

But if your system is a desktop, you don’t need to worry about this. Feel free to download the latest drivers for your GPU. 

To do so, you’ll need to head to the official website of your GPU’s manufacturer. 

For NVIDIA drivers, head to this website and then use the drop-down lists to find your GPU’s exact model.

Downloading NVIDIA Drivers

For AMD drivers, head to this website and then use the drop-down lists to find your GPU’s exact model.

Downloading AMD Drivers

Once the driver file is downloaded, simply double-click on it to start installing the drivers. When asked for the installation type, select “Express” instead of “Custom”.

After the driver installation process finishes, restart your PC and launch Minecraft. The OpenGL 1282 Error should now be fixed.

Reinstall Minecraft

If all else fails, the final step is to reinstall Minecraft. This can fix your problem, as the root cause of the error might just be some corrupted game files. So when you reinstall Minecraft, there won’t be an issue of corrupted files. 

So to reinstall Minecraft, first uninstall it from your system. But before we do that, note that when you uninstall Minecraft, your saved worlds, inventories, mods, and screenshots will be gone forever unless you create a backup for them.

To create a backup, follow the steps listed below:

  1. Open your documents folder and create a new folder within it titled “Minecraft Backup.”
  2. Press Windows Key + R to open the Run dialogue box. 
  3. Type %appdata% and press enter.
    Opening the AppData folder
  4. Open the .minecraft folder.
    Navigating to the .minecraft folder
  5. Create a copy of the saves, screenshots, resource packs, and mods folder.
    Copying important Minecraft save files
  6. Paste them into the Minecraft Backup folder that you created earlier.
    Creating the backup for the save files

When you reinstall Minecraft, you’ll be able to restore your progress by simply pasting these folders into the new .minecraft folder.

Once you’re ready, you can uninstall Minecraft from your PC by following these steps:

  1. Press the Windows Key, type Settings in the search bar, and enter.
    Opening Settings
  2. In the Settings menu, click on Apps.
    Opening the Apps menu
  3. In the search bar above the list of apps, type Minecraft. 
  4. Click on Minecraft and press Uninstall.
    Uninstalling Minecraft
  5. Press Windows Key + R to open the Run Dialogue Box.
  6. Type %appdata% and press enter. 
    Opening the AppData folder
  7. Right-click on the .minecraft folder.
  8. Press delete.
    Deleting residue files of Minecraft
  9. Open up Recycle Bin and permanently delete the .minecraft folder from there.

Minecraft is now fully wiped from your system. So the next step is to install it again by going to Minecraft’s official website. After installing Minecraft, launch the game and see if the OpenGL error went away. 

Содержание

  1. Ошибка OpenGL: 1282 в Minecraft Как исправить?
  2. Загрузите файл opengl32.dll и поместите его в папку Minecraft
  3. Проверьте настройки Minecraft.
  4. Shader
  5. Области рендеринга
  6. Обновить OptiFine
  7. Отключите параметр «Показать ошибки GL»
  8. How to Fix “OpenGL Error 1282 (Invalid Operation)”
  9. Method 1: Manually add the opengl32.dll file
  10. Method 2: Update graphics card drivers
  11. Method 3: Disable shaders
  12. Method 4: Update OptiFine
  13. Method 5: Update Java
  14. Method 6: Try a different game version
  15. Method 7: Turn off Show GL Errors
  16. 10 thoughts on “How to Fix “OpenGL Error 1282 (Invalid Operation)””
  17. Ошибка OpenGL 1282 (недопустимая операция) при использовании GLUT_3_2_CORE_PROFILE
  18. Решение

Ошибка OpenGL: 1282 в Minecraft Как исправить?

Продолжаете видеть ошибку OpenGL: 1282 (недопустимая операция) , появляющаяся в вашей игре Minecraft? Это очень распространенная ошибка для игроков Minecraft. Если вы один из них, это может сильно вас раздражать, поскольку иногда возникает вместе с другими проблемами, такими как черный экран или задержки.

Но не волнуйтесь! Уже есть несколько эффективных способов решить эту проблему. Здесь мы перечисляем исправления, которые вы можете попробовать для ошибки OpenGL: 1282. Взгляните на них ниже и посмотрите, могут ли они вам помочь.

Содержание hide 1 Загрузите файл opengl32.dll и поместите его в папку Minecraft 2 Проверьте настройки Minecraft 2.1 Shader 2.2 Render Regions 3 Обновите OptiFine 4 Отключите параметр Show GL Errors

Загрузите файл opengl32.dll и поместите его в папку Minecraft

Эта ошибка обычно возникает, когда файл opengl32.dll отсутствует в папке Minecraft. Чтобы исправить это:

Шаг 1: Перейдите на эту веб-страницу и загрузите opengl32.dll, подходящий для вашей системы.

* Мы рекомендуем вам проверить совместимость и безопасность загруженного файла перед его использованием.

Шаг 2: Разархивируйте загруженный файл, а затем скопируйте файл opengl32.dll .

Шаг 3: Перейдите туда, где установлен ваш Minecraft (если вы не знаете, щелкните правой кнопкой мыши ярлык на рабочем столе Minecraft, выберите Свойства , затем нажмите Открыть расположение файла ). Затем перейдите в Runtime [версия JRE] > bin и вставьте туда файл opengl32.dll .

Шаг 4: снова запустите игру Minecraft и проверьте наличие ошибки OpenGL Error 1282.

Проверьте настройки Minecraft.

В большинстве случаев отключение некоторых внутриигровых настроек может помочь вам исправить ошибку OpenGL Error 1282. Вы можете проверить две вещи:

Shader

Шаг 1 : Запустите Minecraft.

Шаг 2: в главном меню щелкните Параметры .

Шаг 3: Выберите Шейдеры .

Шаг 4: Выберите ВЫКЛ .

Теперь вы отключили шейдеры в Minecraft. Убедитесь, что это помогло вам решить проблему OpenGL Error: 1282. Если нет, попробуйте отключить следующий параметр…

Области рендеринга

Шаг 1: В главном меню нажмите Параметры .

Шаг 2: Выберите Параметры видео > Производительность .

Шаг 3: Установите для Render Regions значение OFF .

Теперь проверьте свою проблему, чтобы увидеть, сработало ли это. Если сообщение об ошибке OpenGL: 1282 по-прежнему появляется, не беспокойтесь, вы можете попробовать и другие исправления, указанные ниже.

Обновить OptiFine

Сообщение об ошибке OpenGL: 1282 также может появиться, если вы используют устаревшую версию OptiFine. Вы можете попробовать обновить это программное обеспечение, а затем посмотреть, поможет ли это. Чтобы загрузить последнюю версию OptiFine, перейдите на официальную страницу загрузки OptiFine и загрузите последнюю версию этого программного обеспечения. Затем установите его на свой компьютер и посмотрите, поможет ли это избавиться от ошибки OpenGL Error: 1282.

Отключите параметр «Показать ошибки GL»

Иногда вы видите, что все остальное работаетправильно, даже если ошибка OpenGL: 1282 продолжает появляться. В этом случае можно просто отключить уведомление и проигнорировать сообщение. Для этого:

Шаг 1 : Запустите Minecraft.

Шаг 2: В главном меню нажмите Параметры .

Шаг 3: Выберите Настройки видео > Другое .

Шаг 4: Установите для параметра Показать ошибки GL значение ВЫКЛ .

Теперь вы больше не будете видеть раздражающее сообщение в чате.

Сработало ли у вас какое-либо из вышеперечисленных исправлений? Или у вас есть другие эффективные способы исправить ошибку OpenGL: 1282? Расскажите нам, оставив комментарий ниже!

Источник

How to Fix “OpenGL Error 1282 (Invalid Operation)”

The “OpenGL Error 1282 (Invalid operation)” issue is one of the common issues occurring in Minecraft. When this error occurs, you may experience lag issues or error message pop-ups. It’s annoying. But not to worry. You can fix the error with the following methods.

There are seven methods available for you to fix the issue. You can try them one by one until you find the one that works for you.

Method 1: Manually add the opengl32.dll file

The error can be caused by missing the opengl32.dll file in the Minecraft folder. To fix the error , you can try manually adding the opengle32.dll file to the folder. Many Minecraft players have reported they fixed the same error with this fix. You can give it a try and it might work for you too.

You can follow these steps to manually add the opengl32.dll file.

Firstly, download the opengl32.dll file.

1) Open this link and download the “OpenGL fix.7z” file to your computer.

2) Extract the file.

3) In the extracted folder, you’ll see two subfolders: 32 bit and 64 bit. Select one of them according to your Windows version (How to check what Windows version you have?). For example, I have Windows 10 64-bit version, then I need to open the 64 bit folder (see the screenshot below).

4) Copy the opengl32.dll file.

Secondly, paste the opengl32.dll file to the Minecraft folder.

1) Right-click on the shortcut of Minecraft and then select Open file location.

2) Navigate to the following location

MinecraftRuntime*JRE Version*bin

Note: The JRE Version is simply a placeholder. It depends on the game version you have, for example Jre-x64, or something like that.

3) Paste the opengl32.dll file to the bin folder.

4) Re-launch Minecraft and see if the error persists.

Method 2: Update graphics card drivers

A faulty or missing graphics card driver can cause the Minecraft OpenGL 1282 error. You can try updating your graphics card driver and see if it helps.

You can go to the PC manufacturer’s website to download the latest graphics card driver. Before getting started, you need to find out what Windows version you have and what graphics card you have.

Manually updating drivers takes time, and can cause errors if incorrect drivers are installed. So if you don’t have much driver knowledge, you can use Driver Easy to help you.

Driver Easy is a third-party driver update utility with more than 3 million users around the world. You can update the graphics card driver with just a few clicks.

1) Download and install Driver Easy Free on your computer.

2) Launch the application and click Scan Now to detect any problem drivers on your computer. The scan process may take several seconds. Once done, you’ll see a list of drivers that can be updated.

3) Click the Update button next to the graphics card driver, then the driver will be downloaded automatically to your computer. Once the download is done, you can install the driver easily with the step-by-step guide from Driver Easy.

If you upgrade to Driver Easy Pro, you can download and install the driver automatically. Click the Update button, then the graphics card driver will be installed automatically.

Method 3: Disable shaders

Shaders in Minecraft allow you to set different terrains and settings so you can have a better game experience. But in the meantime, they can take up a lot of system resources, and may cause the OpenGL 1282 error. To fix the error, you can try disabling shaders in Minecraft. To do so:

1) Launch Minecraft.

2) On your keyboard, press the Esc key to pull up the Menu screen.

3) Go to Options -> Shaders.

4) Select OFF and click Done.

After you’re done with it, re-launch Minecraft and see if you’re still facing the OpenGL 1282 error.

Method 4: Update OptiFine

The OpenGL Error 1282 can be an OptiFine issue. If you’re using OptiFine for Minecraft , updating OptiFine to the latest version may help remove the error. If not, skip this method and continue to the next method.

Go to the OptiFine download page and download the latest version of OptiFine, then install it on your computer. Once done, check to see if the error still occurs.

Method 5: Update Java

Minecraft relies on Java very much. If you have a low version Java or the Java files are corrupted, the OpenGL Error 1282 can occur. To fix the error, you can try updating Java to the latest version.

Open this link and download the latest version of Java to your computer, then follow the on-screen instructions to install it.

Once the installation completes, re-launch Minecraft and check to see if the OpenGL Error 1282 is fixed.

Method 6: Try a different game version

The error can occur in a specific version of Minecraft. So you could try to switch to a different game version, for example a lower version, and see if the error continues.

Method 7: Turn off Show GL Errors

In some cases, the OpenGL Error 1282 is not a real error but just a bunch of pop-ups. If your game performance is not influenced due to this error, it’s nothing to worry about. But to get rid of these annoying notifications, you can just turn off the Show GL Errors option in Minecraft. After that, you won’t receive any error notifications.

Here’s how to turn off the Show GL Errors option in Minecraft.

1) Launch Minecraft.

2) Go to Options > Video Settings > Others…

3) Click Show GL Errors and turn it off.

4) Save the changes and re-launch Minecraft, then you won’t see the annoying OpenGL Error 1282 message.

Hopefully you can fix OpenGL Error 1282 (Invalid operation) with the steps above. If you have any questions or suggestions, feel free to leave a comment below. I’ll get back to you ASAP.

10 thoughts on “How to Fix “OpenGL Error 1282 (Invalid Operation)””

When i download OpenGL fix.7z it isnt as a file. its just a white paper. and the opengl32.dll doesnt have the subfolder 32 bit and 64 bit. help.

It sounds like you haven’t downloaded the file successfully. Ensure the download is complete when you try to open the file.

that’s because you don’t have a program that allows you to open .7z files. you need to install 7Zip or Winrar to open them

I tried everything and it did not work. I dont want to disable the message because my game lags every time it happens. Very frustrating

Version 1.17.1. It’s bugged

is it a bug from OptiFine or just the game?

I think optifine, whenever I use shaders, the error shows

I get this error without motive in my client, so its affecting my performance, from 59 fps to 170 FPS

the last one works and the opengl fix file 🙂

Источник

Ошибка OpenGL 1282 (недопустимая операция) при использовании GLUT_3_2_CORE_PROFILE

Я пытаюсь использовать более позднюю версию OpenGL, чем версия 2.1 по умолчанию на моем Mac с помощью GLUT_3_2_CORE_PROFILE при инициализации GLUT. Однако это приводит к сбою первой операции OpenGL с недопустимая операция. До вызова этой первой функции не сообщалось об ошибке, и не было сгенерированной ошибки без GLUT_3_2_CORE_PROFILE ,

Содержание errorCheck это просто:

Согласно заголовку, ошибка 1282 возникает при втором вызове errorCheck только:

Строка версии сообщается как 2.1 ATI-1.51.8 без GLUT_3_2_CORE_PROFILE а также 4.1 ATI-1.51.8 с. Требуется ли дальнейшая инициализация в этой новой версии OpenGL?

Решение

glMatrixMode является частью устаревшей Трубопровод с фиксированной функцией и недоступен в профиле ядра OpenGL 3.2.

GLUT использует Legacy Profile по умолчанию для всех созданных контекстов OpenGL. Вы должны опустить GLUT_3_2_CORE_PROFILE :

или же Вы должны ограничить себя функциональностью основного профиля.

Подробные спецификации и различия между профилем ядра и режимом прямой совместимости можно найти на Спецификация OpenGL — реестр Khronos OpenGL

В OpenGL версии 3.0 появилась идея об устаревании функциональности. Многие функции OpenGL объявлены устаревшими, что означает, что пользователям следует избегать их использования, поскольку они могут быть удалены из более поздних версий API. OpenGL 3.1 удалил почти всю функциональность, которая устарела в OpenGL 3.0. Это включает в себя Трубопровод с фиксированной функцией .

Новое расширение, ARB_compatibility , был представлен, когда был открыт OpenGL 3.1. Наличие этого расширения является сигналом для пользователя, что устаревшие или удаленные функции по-прежнему доступны через исходные точки входа и перечисления. Поведение таких реализаций определяется отдельным, гораздо большим, Спецификация OpenGL . Таким образом, была обратно-совместимая спецификация и не обратно-совместимая спецификация.
Однако, поскольку многие реализации в любом случае поддерживают устаревшие и удаленные функции, некоторые реализации хотят иметь возможность предоставить пользователям старших версий GL возможность получить доступ к старым API. Было опробовано несколько методик, и он попал в разделение между контекстами Core и Compatibility.

OpenGL 3.0 был последней редакцией спецификации, которая полностью поддерживала как фиксированные, так и программируемые функции. Тем не менее, большинство аппаратных средств со времен поколения OpenGL 2.0 испытывали недостаток в реальном оборудовании с фиксированной функцией. Вместо этого процессы с фиксированной функцией эмулируются шейдерами, созданными системой.
В OpenGL 3.2 Основной профиль не хватает этих концепций с фиксированной функцией. Профиль совместимости держит их вокруг. Однако большинство новых функций OpenGL не могут работать с фиксированной функцией, даже если теоретически возможно, что они взаимодействуют.

В 2008 году была выпущена версия 3.0 спецификации OpenGL. С этой ревизией Трубопровод с фиксированной функцией а также большинство связанных функций и констант OpenGL объявлены устаревшими. Эти устаревшие элементы и концепции теперь обычно называют устаревшим OpenGL.
Устаревший OpenGL по-прежнему поддерживается некоторыми реализациями, которые поддерживают ядро ​​OpenGL 3.1 или выше, и GL_ARB_compatibility расширение. Реализации, которые не предоставляют это расширение, предлагают только функции, определенные в базовой спецификации OpenGL, на которой основана реализация.

Источник

Я попытался упростить код до минимума, и он все еще не работает:

public class MainActivity extends AppCompatActivity {

AudioRecord rec;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    rec=  new AudioRecord(MediaRecorder.AudioSource.MIC,44100, AudioFormat.CHANNEL_IN_MONO,AudioFormat.ENCODING_PCM_16BIT,8192);

    short buff[] = new short[8192];
    int read = rec.read(buff,0,buff.length);
    System.out.print(read);
}

Всегда возвращает -3 несмотря ни на что. Что мне не хватает?

3 ответа

Лучший ответ

Вместе с моим другом нам наконец удалось решить эту проблему. Вам нужно вызвать AudioRecord.startRecording () перед вызовом read (). Также после того, как вы закончите, вы должны вызвать AudioRecord.stop (). Интересно, почему так сложно найти эту основную информацию?


7

AlanKalane
19 Июн 2017 в 14:50

Вы проверили разрешения в манифесте?

</application>

<uses-permission android:name="android.permission.RECORD_AUDIO" /> 

Документация гласит:

Считывает аудиоданные с аудиооборудования для записи в байтовый массив. Формат, указанный в конструкторе AudioRecord, должен быть ENCODING_PCM_8BIT, чтобы соответствовать данным в массиве.

< Сильный > < EM> Параметры

Байт audioData: массив, в который записываются записанные аудиоданные. Это значение никогда не должно быть нулевым.

OffsetInBytes int: индекс в audioData, из которого записываются данные, выраженный в байтах.

Size Bytes in: количество запрошенных байтов. Возвращает

Int ноль или положительное число прочитанных байтов или один из следующих кодов ошибок. Количество байтов не будет превышать sizeInBytes.

ERROR_INVALID_OPERATION, если объект не инициализирован должным образом

Я думаю, что вы должны проверить инициализацию объекта AudioRecord. Посмотрите на этот ответ: Пример Android AudioRecord


3

Dany Pop
19 Июн 2017 в 08:17

Согласно документации Android —

-3 означает, что это недопустимая операция.

Обозначает сбой из-за неправильного использования метода.

Постоянное значение: -3 (0xfffffffd)

Эта проблема, скорее всего, связана с тем, что не удалось создать экземпляр AudioRecord с указанными вами параметрами.

После создания объекта попробуйте проверить правильность его инициализации с помощью метода getState

    if (rec.getState() == AudioRecord.STATE_UNINITIALIZED) {
        // Oops looks like it was not initalized correctly
    }

Если это состояние действительно неинициализировано, попробуйте установить другие свойства звука. Проверьте документацию для AudioRecord [конструктор] (https : //developer.android.com/reference/android/media/AudioRecord.html#AudioRecord (int, int, int, int, int)), документация содержит подробные сведения о том, как инициализировать различные параметры ,


2

bluefalcon
19 Июн 2017 в 11:52

Ошибка OpenGL: 1282 (недопустимая операция) — распространенная ошибка Minecraft. Эта ошибка особенно распространена в версии Minecraft с установленными модами. Сообщение об ошибке рассылается спамом в ваш чат и иногда даже делает ваш экран черным. По словам игроков Minecraft, эта проблема расстраивает и требует быстрого решения. Именно поэтому в этом посте мы обсудим этот вопрос и посмотрим, что вам нужно делать, если вы видите Ошибка OpenGL: 1282 (недопустимая операция) в Майнкрафте.

Ошибка OpenGL: 1282 (недопустимая операция) в Minecraft

Исправить ошибку OpenGL: 1282 (недопустимая операция) в Minecraft

Если вы видите ошибку OpenGL: 1282 (недопустимая операция) в Minecraft, попробуйте следующие решения и предложения для решения проблемы.

  1. Отключить отображение ошибок GL
  2. Убедитесь, что ваши моды не повреждены
  3. Установите последнюю версию Java
  4. Отключить шейдеры
  5. Обновить Optfine
  6. Обновите графические драйверы
  7. Переустановите Майнкрафт

Поговорим о них подробно.

1]Отключить Показать ошибки GL

Некоторые пользователи просто видят ошибку GL без каких-либо последствий и вполне могут играть в игру. Если вы относитесь к этой категории, то ваша проблема будет решена путем простого отключения параметра «Показать ошибки GL» в настройках Minecraft. Вы не увидите спам-сообщения после внесения следующих настроек.

  1. Запустите Майнкрафт.
  2. Откройте свой мир и нажмите клавишу Esc (Escape).
  3. Перейти к Параметры > Настройки видео.
  4. Нажмите «Другие», а затем отключите «Показать ошибки GL».
  5. Наконец, выберите Готово.

Надеюсь, это поможет вам.

2]Убедитесь, что ваши моды не повреждены

Чаще всего с проблемой сталкивались пользователи, установившие моды Minecraft на свои компьютеры. Если это применимо в вашем случае, мы рекомендуем вам удалить все моды и посмотреть, решена ли проблема. Если удаление модов привело к удалению спама с ошибками GL, добавьте их один за другим, чтобы вы могли наткнуться на фактического виновника. Если причина, по которой вы видите эту ошибку, заключается в повреждении модов, это решение поможет.

3]Установите последнюю версию Java

Если вы используете Java-версию Minecraft, важно поддерживать Java на вашем компьютере в актуальном состоянии. Чтобы сделать то же самое, вы можете посетить OEM-производителя Java и загрузить его последнюю версию или выполнить предписанные шаги для обновления Java.

  1. Откройте панель управления.
  2. Изменить Просмотр по к Большие иконки.
  3. Перейти к Обновлять вкладка
  4. Нажми на Обновить сейчас кнопка.
  5. Вам будет предложено подтвердить свои действия, если доступно обновление, поэтому сделайте то же самое и закройте панель управления.

Запустите Minecraft и посмотрите, сохраняется ли проблема. Надеюсь, это поможет вам.

4]Отключить шейдеры

Если у вас есть шейдеры, работающие вместе с Optifine Minecraft, это может конфликтовать с некоторыми модами Minecraft. Эти шейдеры могут сделать ваш Minecraft эстетически привлекательным, но они также могут потреблять много памяти и мощности процессора. Итак, если вы видите ошибку OpenGL, отключите шейдеры. Затем запустите Minecraft и посмотрите, видите ли вы спам с ошибкой OpenGL. Если проблема вызвана шейдерами, их отключение поможет.

5]Обновить Optfine

Если вы используете устаревшую версию Optfine, вполне вероятно, что она вызывает рассматриваемую ошибку. Вот почему нам нужно установить последнюю версию с optfine.net. После загрузки установите инструмент и запустите Minecraft. Вам нужно выбрать последнюю версию Optfine внутри Minecraft. Итак, сделайте это и проверьте, решена ли проблема.

6]Обновите графические драйверы

OpenGL работает вместе с вашим графическим процессором для улучшения графики Minecraft. Когда вы обновляете свои графические драйверы, прошивка OpenGL автоматически обновляется. И если вы являетесь активным пользователем Windows, вы знаете, как легко обновляются драйверы в большинстве случаев. Так вот, «большую часть времени» не означает постоянно. Существует вероятность того, что ваш драйвер графического процессора устарел, в результате чего вы видите соответствующее сообщение об ошибке. Существует множество способов обновления графических драйверов, некоторые из которых мы упомянули ниже, поэтому выберите один и приступайте к делу.

Надеюсь, это поможет вам.

7]Переустановите Майнкрафт

Если ничего не помогло, в крайнем случае переустановите Minecraft и посмотрите, поможет ли это. Вы также можете создать резервную копию файлов игры перед ее установкой. Откройте «Выполнить», введите %appdata% и нажмите Enter. Откройте папку .minecraft и создайте резервную копию сейвы, скриншоты, ресурспаки, а также моды. Вы можете удалить приложение, переустановить его и вставить резервную копию в соответствующие места. Когда вы открываете Minecraft, спам с ошибкой OpenGL не появляется.

Надеюсь, вы сможете решить проблему, используя решения, упомянутые в этом посте.

Как избавиться от ошибки OpenGL 1282?

В большинстве случаев ошибка OpenGL 1282 — это не что иное, как спам-сообщения, которые мешают пользователю играть в игру. Это можно решить, отключив параметр «Показать ошибки GL» в настройках Minecraft. Однако пользователи сообщают о случаях, когда это сообщение об ошибке делало весь экран черным. Поскольку это более серьезный случай, существует несколько решений, которые могут устранить несколько причин этой ошибки. Вы должны проверить решения, упомянутые в этом посте, чтобы решить проблему.

Читайте: исправить ошибку удаления программы запуска Minecraft 0x80080204

Что означает ошибка OpenGL в Minecraft?

OpenGL или Open Graphics Library — это кроссплатформенный API, используемый для рендеринга 2D- и 3D-векторной графики. В Minecraft он используется для улучшения графики игры. Если вы видите ошибку OpenGL, это означает, что что-то не так с этим API или инструментами, которые работают вместе с ним.

Читайте также: Исправлена ​​ошибка, из-за которой игра Minecraft вылетала с кодом выхода 0.

Понравилась статья? Поделить с друзьями:
  • Error player error connection failed на телевизоре
  • Error play video ivi на телевизоре
  • Error play video city car driving
  • Error platform version is not compatible with
  • Error platform version firefox