Previously countries that are not supported by the YouTube API would default to the US trending videos.
Current behavior: Display appropriate message (e.g Region not supported by YouTube)
Implementation
YTSupportedCountriesSearch.java
calls the YouTube API in order to fetch the countries that are supported by it
has method getSupportedCountries() which returns a list of country codes (alpha 2) belonging to supported countries
YTSupportedCountriesServlet.java
calls the method getSupportedCountries() from the class YTSupportedCountriesSearch.java (only one time, right after servlet instantiation)
returns the list of supported country codes in json format
script.js
fetches the list of YT supported countries from the YTSupportedCountriesServlet.java and stores them in array
when marker is clicked
check if the country code that corresponds to that marker is in the array of supported country codes
if yes -> fetch YouTube trending videos
otherwise -> Display "Region not supported by YouTube"
Previously countries that are not supported by the YouTube API would default to the US trending videos. Current behavior: Display appropriate message (e.g Region not supported by YouTube)
Implementation
YTSupportedCountriesSearch.java
getSupportedCountries()
which returns a list of country codes (alpha 2) belonging to supported countriesYTSupportedCountriesServlet.java
getSupportedCountries()
from the classYTSupportedCountriesSearch.java
(only one time, right after servlet instantiation)script.js
YTSupportedCountriesServlet.java
and stores them in array