Określ bitrate i format multimediów
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Odpowiedzi VAST mogą zawierać wiele plików multimedialnych z różnymi
z szybkością transmisji bitów i w różnych formatach. Pakiet SDK wybiera odpowiednią szybkość transmisji bitów
na podstawie bieżących warunków sieci:
- maks. 500 kb/s w przypadku połączenia komórkowego
- bez ograniczeń przez Wi-Fi
Jeśli chcesz określić preferowane formaty wideo i szybkość transmisji bitów, użyj parametru
AdsRenderingSettings
do przekazywania tych informacji
w momencie inicjowania Menedżera reklam.
function onAdsManagerLoaded(adsManagerLoadedEvent) {
const adsRenderingSettings = new google.ima.AdsRenderingSettings();
adsRenderingSettings.bitrate = 1024; //kbits
adsRenderingSettings.mimeTypes = [ 'video/mp4', 'video/webm’ ];
adsManager = adsManagerLoadedEvent.getAdsManager(
videoContent, adsRenderingSettings);
...
}
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-31 UTC.
[null,null,["Ostatnia aktualizacja: 2025-08-31 UTC."],[[["\u003cp\u003eVAST responses may include multiple media files with varying bitrates and formats, with the SDK automatically selecting the optimal bitrate based on network conditions (500 kbit/s maximum for cellular and unlimited for WiFi).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize preferred video formats and bitrates by utilizing an \u003ccode\u003eAdsRenderingSettings\u003c/code\u003e instance during Ads Manager initialization to specify desired settings like bitrate and MIME types.\u003c/p\u003e\n"]]],[],null,["# Specify bitrate and media format\n\nVAST responses can contain multiple media files with different\nbitrates and in different formats. The SDK chooses the appropriate bitrate\nbased on the current network conditions:\n\n- max 500 kbit/s for cellular connection\n- unlimited for WiFi\n\nIf you want to specify preferred video formats and bitrate, use an\n[AdsRenderingSettings](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsRenderingSettings)\ninstance to pass this information at the time of Ads Manager initialization. \n\n```gdscript\nfunction onAdsManagerLoaded(adsManagerLoadedEvent) {\n const adsRenderingSettings = new google.ima.AdsRenderingSettings();\n adsRenderingSettings.bitrate = 1024; //kbits\n adsRenderingSettings.mimeTypes = [ 'video/mp4', 'video/webm' ];\n adsManager = adsManagerLoadedEvent.getAdsManager(\n videoContent, adsRenderingSettings);\n ...\n}\n```"]]