[NUI][API14] Add WebView APIs for video playback notification.#7722
[NUI][API14] Add WebView APIs for video playback notification.#7722huayongxu wants to merge 1 commit into
Conversation
Original-Author: yehyeon.kim@samsung.com Co-Authored-By: Cline SR <GaussO3.4>
There was a problem hiding this comment.
Code Review
This pull request introduces several new events to the WebView class to monitor video playback states, including Ready, Started, Finished, Stopped, and Paused, along with their corresponding native interop callback registrations. The review feedback suggests optimizing memory usage by replacing "new EventArgs()" with the cached singleton "EventArgs.Empty" when raising these events to avoid unnecessary allocations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| private void OnPlaybackVideoReady() | ||
| { | ||
| playbackVideoReadyEventHandler?.Invoke(this, new EventArgs()); | ||
| } | ||
|
|
||
| private void OnPlaybackVideoStarted() | ||
| { | ||
| playbackVideoStartedEventHandler?.Invoke(this, new EventArgs()); | ||
| } | ||
|
|
||
| private void OnPlaybackVideoFinished() | ||
| { | ||
| playbackVideoFinishedEventHandler?.Invoke(this, new EventArgs()); | ||
| } | ||
|
|
||
| private void OnPlaybackVideoStopped() | ||
| { | ||
| playbackVideoStoppedEventHandler?.Invoke(this, new EventArgs()); | ||
| } | ||
|
|
||
| private void OnPlaybackVideoPaused() | ||
| { | ||
| playbackVideoPausedEventHandler?.Invoke(this, new EventArgs()); | ||
| } |
There was a problem hiding this comment.
Using new EventArgs() allocates a new instance of EventArgs every time the event is raised. Since video playback events can be triggered frequently, it is highly recommended to use the cached singleton EventArgs.Empty instead to avoid unnecessary memory allocations and reduce garbage collection pressure.
private void OnPlaybackVideoReady()
{
playbackVideoReadyEventHandler?.Invoke(this, EventArgs.Empty);
}
private void OnPlaybackVideoStarted()
{
playbackVideoStartedEventHandler?.Invoke(this, EventArgs.Empty);
}
private void OnPlaybackVideoFinished()
{
playbackVideoFinishedEventHandler?.Invoke(this, EventArgs.Empty);
}
private void OnPlaybackVideoStopped()
{
playbackVideoStoppedEventHandler?.Invoke(this, EventArgs.Empty);
}
private void OnPlaybackVideoPaused()
{
playbackVideoPausedEventHandler?.Invoke(this, EventArgs.Empty);
}
Internal API ChangedAdded: 5, Removed: 0, Changed: 0Added+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.EventHandler Tizen.NUI.BaseComponents.WebView::PlaybackVideoFinished
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.EventHandler Tizen.NUI.BaseComponents.WebView::PlaybackVideoPaused
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.EventHandler Tizen.NUI.BaseComponents.WebView::PlaybackVideoReady
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.EventHandler Tizen.NUI.BaseComponents.WebView::PlaybackVideoStarted
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.EventHandler Tizen.NUI.BaseComponents.WebView::PlaybackVideoStopped
|
|
🤖 [AI Review] Reviewed — no findings. Scope checked:
No 🔴 critical issues, no 🟡 suggestions to flag. Automated review — final merge decision rests with human reviewers. |
Original-Author: yehyeon.kim@samsung.com
Description of Change
the related patch at binder side:
https://review.tizen.org/gerrit/c/platform/core/uifw/dali-csharp-binder/+/346690
API Changes