From 9d441e1d260e12158948982d6c646abe3ef6bbd3 Mon Sep 17 00:00:00 2001 From: the-leo Date: Thu, 10 Aug 2023 14:43:44 +0300 Subject: [PATCH] Added DivPlayer volume regress --- test_data/regression_test_data/index.json | 7 ++ .../video/video_volume_control.json | 110 ++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 test_data/regression_test_data/video/video_volume_control.json diff --git a/test_data/regression_test_data/index.json b/test_data/regression_test_data/index.json index 8999ae572..1824a79bf 100644 --- a/test_data/regression_test_data/index.json +++ b/test_data/regression_test_data/index.json @@ -1827,6 +1827,13 @@ ], "file": "video/video_with_controls.json" }, + { + "title": "Video volume control", + "tags": [ + "DivVideo" + ], + "file": "video/video_volume_control.json" + }, { "title": "Disappearing actions with DivVideo", "tags": [ diff --git a/test_data/regression_test_data/video/video_volume_control.json b/test_data/regression_test_data/video/video_volume_control.json new file mode 100644 index 000000000..7669cbf34 --- /dev/null +++ b/test_data/regression_test_data/video/video_volume_control.json @@ -0,0 +1,110 @@ +{ + "templates": { + "control_button": { + "type": "image", + "aspect": { + "ratio": 1 + }, + "paddings": { + "top": 3, + "bottom": 3 + }, + "margins": { + "left": 5, + "right": 5 + }, + "scale": "fit", + "width": { + "type": "fixed", + "value": 44 + } + } + }, + "card": { + "log_id": "video", + "variables": [ + { + "name": "video_time", + "type": "integer", + "value": 0 + }, + { + "name": "video_1_muted", + "type": "boolean", + "value": false + } + ], + "states": [ + { + "state_id": 0, + "div": { + "type": "container", + "orientation": "vertical", + "items": [ + { + "type": "video", + "id": "bears_video", + "video_sources": [ + { + "type": "video_source", + "url": "https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8", + "mime_type": "video/mp4" + } + ], + "repeatable": true, + "autostart": true, + "muted": "@{video_1_muted}", + "elapsed_time_variable": "video_time", + "height": { + "type": "fixed", + "value": 320 + }, + "background": [ + { + "type": "solid", + "color": "#000000" + } + ] + }, + { + "type": "container", + "orientation": "horizontal", + "width": { + "type": "match_parent" + }, + "height": { + "type": "wrap_content" + }, + "margins": { + "top": 10 + }, + "content_alignment_horizontal": "center", + "items": [ + { + "type": "control_button", + "image_url": "https://yastatic.net/s3/home/divkit/mute_button.png", + "actions": [ + { + "log_id": "mute", + "url": "div-action://set_variable?name=video_1_muted&value=true" + } + ] + }, + { + "type": "control_button", + "image_url": "https://yastatic.net/s3/home/divkit/unmute_button.png", + "actions": [ + { + "log_id": "unmute", + "url": "div-action://set_variable?name=video_1_muted&value=false" + } + ] + } + ] + } + ] + } + } + ] + } +}