This topic covers how to change the Tizen WASM Player configuration at runtime, and how to handle errors during playback.
Some aspects of a playing stream can be reconfigured during runtime. Changes to following parameters are supported:
To change specific runtime configurations, send a keyframe packet that has the new configuration value set:
To change the stream resolution:
ElementaryMediaPacket packet; // ... packet.width = /* New width */; packet.height = /* New height */; // ...
To change the stream framerate:
ElementaryMediaPacket packet; // ... packet.framerate_num = /* New framerate_num */; packet.framerate_den = /* New framerate_den */; // ...
To avoid video glitches, it is recommended that the new FPS is a multiple of the old one. Transitions between 30 and 60 FPS are safe, as well as 29.97 and 59.94.
If AppendPacketAsync(), AppendEncryptedPacketAsync(), or AppendEndOfTrackAsync() are used, the app must detect async append errors using ElementaryMediaTrackListener. The OnAppendError() event should be handled in a custom implementation of ElementaryMediaTrackListener:
AppendPacketAsync()
AppendEncryptedPacketAsync()
AppendEndOfTrackAsync()
ElementaryMediaTrackListener
OnAppendError()
class MyMediaElementListener : public samsung::wasm::ElementaryMediaTrackListener { using OperationResult = samsung::wasm::OperationResult; // ... // Override virtual OnAppendError method void OnAppendError(OperationResult result) override { // Handle append error } // ... };
The platform multimedia pipeline runs asynchronously. Elementary media packets are moved through the pipeline and processed after the AppendPacket() operation is finished. The WASM Player verifies as much data as feasible when its API is called, however some errors can still happen asynchronously (such as decoding errors).
AppendPacket()
The app needs to detect asynchronous errors using HTMLMediaElementListener. The OnError() event must be handled in a custom implementation of HTMLMediaElementListener:
HTMLMediaElementListener
OnError()
class MyMediaElementListener : public samsung::html::HTMLMediaElementListener { using MediaError = samsung::html::MediaError; // ... // Override virtual OnError method void OnError(MediaError error_code, const char* error_msg) override { // Handle media error } // ... };
error_msg