Skip to content

Commit e49ca12

Browse files
Merge pull request #295153 from sloanster/patch-33
Create optimizing-video-placement
2 parents d5e8d88 + a054d3e commit e49ca12

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
ms.author: micahvivion
3+
title: Place video on a web page based on resolution size
4+
titleSuffix: An Azure Communication Services quickstart
5+
description: This document describes how to place video on a web page based on resolution size to optimize video placement and enhance overall page performance.
6+
author: sloanster
7+
services: azure-communication-services
8+
ms.date: 03/07/2025
9+
ms.topic: quickstart
10+
ms.service: azure-communication-services
11+
ms.subservice: calling
12+
ms.custom: mode-other, devx-track-js
13+
---
14+
15+
# Best practices for subscribing to video feeds
16+
17+
A crucial element to consider when building web apps is how to best integrate video into the page layout. The placement and number of videos can impact page performance, user quality experience, and overall aesthetic. This article includes guidelines to help developers determine how many videos to place on a web page and the best video resolution size to optimize the end user experience.
18+
19+
## Understanding video resolution
20+
21+
Developers need to know important details about video resolution. Resolution refers to the number of pixels displayed on a video output, typically measured in `width x height` format. Higher resolution means more pixels, leading to sharper and clearer images. Incoming video resolutions available in Azure Communication Services video calling include:
22+
23+
- 1080p (Full HD): 1920 x 1080 pixels
24+
- 720p (HD): 1280 x 720 pixels
25+
- 540p (qHD): 960 x 540 pixels
26+
- 360p (SD): 640 x 360 pixels
27+
- 240p: 426 x 240 pixels
28+
- 180p: 320 x 180 pixels
29+
30+
## Factors influencing video quality
31+
32+
Several factors influence how many videos you can effectively place on a web page. These factors include device type, resolution, bandwidth available, and user experience considerations.
33+
34+
### Local device abilities
35+
36+
The type of device used to display the web page plays a significant role. For example, desktops and laptops with larger screens can accommodate more videos than mobile devices. We recommend using [responsive design techniques](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout/Responsive_Design) to adjust the number and sizes of videos based on screen dimensions.
37+
38+
In addition, the local machine must process, encode, and display these videos properly. The size of the local monitor screen and browser abilities also determine the number of active videos that can be displayed simultaneously on a web page.
39+
40+
### Resolution and video screen size
41+
42+
The display resolution of the end user device directly affects the number of videos you can display per page. The higher the resolution of the monitor and screen, the more videos you can display.
43+
44+
Remember that for each video you place on a page, the more internet bandwidth the videos require. In addition, the local machine must have sufficient performance capabilities to encode and display the video properly.
45+
46+
We recommend balancing the video quality and performance. Don't fill every pixel on the screen with video output, which can overwhelm the user. Consider the incoming and outgoing bandwidth as you add more videos to a page.
47+
48+
### Internet bandwidth considerations
49+
50+
To improve the end user experience, we need to understand how internet speeds are measured and what factors can influence them. Internet speeds are typically measured in megabits per second (Mbps), which indicates the rate at which data is downloaded or uploaded. Several factors can affect these speeds, including the type of internet connection (fiber, cable, wifi, cellular), the quality of the networking equipment (modem, router), and the number of devices connected to the network.
51+
52+
When placing multiple videos on a web page, consider the user's network bandwidth. Higher resolution videos require more data to stream. The more overall videos placed on a page, the more bandwidth each one consumes. If someone connects to the internet via a connection with lower overall bandwidth throughput, their ability to stream higher resolution videos or multiple videos on a page are limited. Conversely, if someone has higher internet bandwidth for both inbound and outbound traffic, they have a greater ability to deliver and consume high-resolution videos and accommodate more videos on the page.
53+
54+
## Methods to best optimize how you handle incoming video streams
55+
56+
### Use the Web UI Library
57+
58+
The Azure Communication Services [Web UI Library](../../concepts/ui-library/ui-library-overview.md) is a powerful tool for developers looking to create seamless and visually appealing web applications. The Web UI Library offers a comprehensive set of pre-built UI components that are easy to integrate and highly customizable. This solution enables developers to focus on building functionality rather than designing from scratch.
59+
60+
The Web UI Library ensures consistent design standards across different projects and platforms, enhancing user experience and reducing development time. Its extensive documentation and active community support make it an excellent choice for both beginners and experienced developers. By applying the Web UI Library, you can streamline your workflow, create professional-quality interfaces, and deliver engaging web applications more efficiently. Also, using the Web UI Library removes the guesswork of determining how many videos you can optimally subscribe to at one time.
61+
62+
### Use optimal video count API
63+
64+
The Azure Communication Services WebJS SDK introduced the [Optimal Video Count (OVC)](../../how-tos/calling-sdk/manage-video.md?pivots=platform-web) that informs applications how many incoming videos from different participants can be optimally rendered during a group call. The `optimalVideoCount` property adjusts dynamically based on **network bandwidth** and **hardware capabilities**. The optimal video count returns an integer defining the ideal number of videos that can be displayed on a web page. Applications should update the number of videos rendered according to the output from OVC. Developers should ensure that their application subscribes to changes in the `Optimal Video Count` in group calls and adjust the number of videos being rendered on a web page dynamically based on the OVC count. The value from optimal video count (OVC) is updated every 10 seconds.
65+
66+
You need to reference the feature `OptimalVideoCount` via the feature method of the Call object. You can then set a listener via the on method of the `OptimalVideoCountCallFeature` to be notified when the `optimalVideoCount` changes. To unsubscribe from the changes, you can call the off method. The current maximum number of incoming videos that can be rendered on a web page is **16**. To properly support 16 incoming videos, the computer should have a minimum of 16-GB RAM and a 4-core or greater CPU that is no older than three years old.
67+
68+
```javascript
69+
const optimalVideoCountFeature = call.feature(Features.OptimalVideoCount);
70+
optimalVideoCountFeature.on('optimalVideoCountChanged', () =\> {
71+
const localOptimalVideoCountVariable = optimalVideoCountFeature.optimalVideoCount;
72+
})
73+
```
74+
75+
When there's a change in the optimal video count value, if the result indicates increased capacity on the local computer for more incoming videos, you can create a new incoming video using the [`createView`](/javascript/api/azure-communication-services/@azure/communication-calling/videostreamrenderer?view=azure-communication-services-js&preserve-view=true#@azure-communication-calling-videostreamrenderer-createview) method to display more incoming video streams to be displayed on the page.
76+
77+
Conversely, if the optimal count decreases and is [less than the current number of videos on the page](../../resources/troubleshooting/voice-video-calling/video-issues/reaching-max-number-of-active-video-subscriptions.md), consider disposing of a video using the dispose method and updating the application layout accordingly.
78+
79+
### Things to consider when adding a 1080P or 720P video to a page.
80+
81+
In the version 1.33 and later of the WebJS SDK:
82+
83+
- You can place one 1080p incoming video with the rest smaller than 720P.
84+
- You can place two 720p incoming videos with the rest smaller than 720p.
85+
86+
For instance, in a group call where seven participants have their video cameras on, on each client page you can select two participants' videos are displayed at higher resolutions. These two participants set to show their video at 720p by setting their views on the web page to be 720 pixels in height by 1280 pixels in width (or greater). The remaining five participant videos should be set to a lower resolution, such as 360p or lower.
87+
88+
- To ensure that the total number of rendered videos remains below the OVC value threshold, review and adhere to the [Optimal Video Count (OVC)](../../how-tos/calling-sdk/manage-video.md?pivots=platform-web).
89+
- Each client can specify which user's video they want to receive and set individual resolution sizes on their respective machines.
90+
- Each participant's ability to send a specific video resolution can vary. Some computers are equipped with higher quality cameras, enabling them to transmit a 1080p video. Conversely, some mobile browsers have lower video transmission capabilities, such as only 540p. If you embedded the video resolution to be 1080p or 720p in a page, the incoming video might not match that resolution. In this case, the system upscales the video stream to fill the video renderer size.
91+
- Currently, a maximum of two 720p video streams can be rendered on a web page. If more than two 720p streams are enabled, all 720p video renditions are streamed at 540p.
92+
- The maximum number of incoming remote streams that can be subscribed to is 16 video streams plus 1 screen sharing on desktop browsers, and 4 video streams plus 1 screen sharing on web mobile browsers.
93+
- Azure Communication Services video [Simulcast](../../concepts/voice-video-calling/simulcast.md) ability enhances video streaming by enabling a single video delivered by an end client at multiple resolutions and bitrates simultaneously.
94+
95+
This function enables viewers with varying network conditions to select which video rendition to select to receive for the best possible video quality without buffering or interruptions. By optimizing bandwidth usage, simulcast sends higher resolution streams only to users who can support them. This behavior minimizes unnecessary data transmission. Simulcast improves the overall user experience by providing stable and consistent video quality and enables adaptive streaming.
96+
97+
Simulcast isn't supported on all browser devices. Currently, simulcast is unavailable when sending videos on mobile browsers or macOS Safari. If a participant attempts to render 720p video from a user on iOS Safari, Android Chrome, or macOS Safari and another participant on the call tries to render the same video at a smaller resolution, both receive the smaller resolution. This change happens because the devices prioritize smaller resolutions when simulcast send isn't supported.
98+
99+
## Conclusion
100+
101+
To determine how many videos to place on a web page, you need to carefully consider resolution, device type, bandwidth, and user experience. Follow these guidelines and best practices to create web apps that not only look appealing but also function seamlessly, providing an optimal viewing experience for users across various devices and connection speeds.

articles/communication-services/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,9 @@ items:
494494
href: tutorials/add-video-augmented-reality-tutorial.md
495495
- name: Set video constraints in a calling app
496496
href: quickstarts/voice-video-calling/get-started-video-constraints.md
497+
- name: Optimize video placement on your web app
498+
href: quickstarts/voice-video-calling/optimizing-video-placement.md
499+
displayName: Optimal Video Count, OVC, dual pin
497500
- name: Simulcast
498501
href: concepts/voice-video-calling/simulcast.md
499502
displayName: diagnostics, diagnose, feedback, quality, reliability, users, call, quick, satisfaction, improve, issues

0 commit comments

Comments
 (0)