Prayer Times: Responsive Islamic Prayer Times

Prayer Times displays the five daily prayers (Fajr, Dhuhr, Asr, Maghrib, Isha), highlights the next one with a live countdown, and shows the current Hijri date. Prayer data comes from the Aladhan API.

Display Modes

The widget measures the zone’s aspect ratio at runtime and picks a layout automatically, no extra setup needed.

ModeLayout
Banner / TickerHorizontal scrolling marquee of all prayers, next one tagged
LandscapeHeader, next-prayer hero, row of prayer cells
SquareFull screen next-prayer hero only
PortraitHeader, hero, vertical list of prayers

Highlights

Configuration

All parameters are set through any CMS that can read config.xml, here shown in Garlic-Hub.

Location

Provide either coordinates or city and country. Coordinates take priority, the widget only falls back to city and country when latitude or longitude is missing. Without any location set, the widget shows a “No location configured” notice instead of rendering.

ParameterDefaultDescription
latitudeLatitude, e.g. 51.5074
longitudeLongitude, e.g. -0.1278
cityCity name, used only if coordinates are absent
countryCountry name, paired with city

Calculation

ParameterDefaultDescription
method3Calculation method id, see table below
school0Asr calculation: 0 = Shafi (standard), 1 = Hanafi
timezoneEurope/LondonIANA timezone string, leave empty to let the API infer it from the location
tunePer-prayer minute offsets, see Fine-Tuning below
latitudeAdjustmentMethodHigh-latitude rule where Fajr and Isha angles do not occur on some days: 1 = Middle of the Night, 2 = One Seventh, 3 = Angle Based. Leave empty everywhere else

Results differ by a few minutes between calculation authorities due to local tuning, pick the method closest to the install location. Common ids:

idMethod
2Islamic Society of North America (ISNA)
3Muslim World League (default)
4Umm al-Qura University, Makkah
5Egyptian General Authority of Survey
13Diyanet İşleri Başkanlığı, Turkey

The full list of method ids is available at api.aladhan.com/v1/methods.

Display

ParameterDefaultDescription
langenUI language: en, ar, de
timeFormat2424 or 12 hour clock
showSunrisetrueShow the sunrise time. Sunrise is not a prayer, it marks the end of Fajr’s window and the end of Suhoor
showJumuahtrueOn Fridays, relabel Dhuhr as “Jumu’ah”
highlightNexttrueHighlight the next prayer with the hero block and accent color
accentColor#0F6E56Highlight color for the next-prayer focus
scrollSpeed60Banner / ticker marquee speed in pixels per second

Fine-Tuning

tune is a comma separated string of nine integer minute offsets, in this fixed order:

imsak,fajr,sunrise,dhuhr,asr,maghrib,sunset,isha,midnight

Example: 0,2,0,2,0,1,0,2,0 adds 2 minutes to Fajr, Dhuhr and Isha, and 1 minute to Maghrib. Values may be negative, and tuning one prayer does not affect the others. Leave empty to use the raw calculated times.

Network Access

The widget contacts a single host, api.aladhan.com. Make sure this host is reachable from the player’s network.

SMIL Example

<ref src="PrayerTimes.wgt">
  <param name="latitude"   value="51.5074"/>
  <param name="longitude"  value="-0.1278"/>
  <param name="method"     value="3"/>
  <param name="timeFormat" value="24"/>
</ref>

Data Source and Credits

Prayer times, Hijri dates and calculation methods are provided by the Aladhan API, part of the Islamic Network. The widget does not modify the returned times beyond the optional tune offsets you configure.

Download

Download Prayer Times Widget