forked from microsoft/playwright-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIScreencast.cs
More file actions
90 lines (80 loc) · 3.68 KB
/
IScreencast.cs
File metadata and controls
90 lines (80 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* MIT License
*
* Copyright (c) Microsoft Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.Threading.Tasks;
namespace Microsoft.Playwright;
/// <summary><para>Interface for capturing screencast frames from a page.</para></summary>
public partial interface IScreencast
{
/// <summary>
/// <para>
/// Starts the screencast. When <see cref="IScreencast.StartAsync"/> is provided, it
/// saves video recording to the specified file. When <see cref="IScreencast.StartAsync"/>
/// is provided, delivers JPEG-encoded frames to the callback. Both can be used together.
/// </para>
/// <para>**Usage**</para>
/// </summary>
/// <param name="options">Call options</param>
Task<IAsyncDisposable> StartAsync(ScreencastStartOptions? options = default);
/// <summary>
/// <para>
/// Stops the screencast and video recording if active. If a video was being recorded,
/// saves it to the path specified in <see cref="IScreencast.StartAsync"/>.
/// </para>
/// </summary>
Task StopAsync();
/// <summary>
/// <para>
/// Adds an overlay with the given HTML content. The overlay is displayed on top of
/// the page until removed. Returns a disposable that removes the overlay when disposed.
/// </para>
/// </summary>
/// <param name="html">HTML content for the overlay.</param>
/// <param name="options">Call options</param>
Task<IAsyncDisposable> ShowOverlayAsync(string html, ScreencastShowOverlayOptions? options = default);
/// <summary>
/// <para>
/// Shows a chapter overlay with a title and optional description, centered on the page
/// with a blurred backdrop. Useful for narrating video recordings. The overlay is removed
/// after the specified duration, or 2000ms.
/// </para>
/// </summary>
/// <param name="title">Title text displayed prominently in the overlay.</param>
/// <param name="options">Call options</param>
Task ShowChapterAsync(string title, ScreencastShowChapterOptions? options = default);
/// <summary>
/// <para>
/// Enables visual annotations on interacted elements. Returns a disposable that stops
/// showing actions when disposed.
/// </para>
/// </summary>
/// <param name="options">Call options</param>
Task<IAsyncDisposable> ShowActionsAsync(ScreencastShowActionsOptions? options = default);
/// <summary><para>Shows overlays.</para></summary>
Task ShowOverlaysAsync();
/// <summary><para>Removes action decorations.</para></summary>
Task HideActionsAsync();
/// <summary><para>Hides overlays without removing them.</para></summary>
Task HideOverlaysAsync();
}