Skip to content

Commit

Permalink
Update cdn info
Browse files Browse the repository at this point in the history
  • Loading branch information
meezaan committed May 29, 2022
1 parent 54addf0 commit c24aa7f
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 25 deletions.
132 changes: 107 additions & 25 deletions views/cdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,68 @@
Al Quran Content Delivery Network (CDN)
</h4>
<p>
Al Quran Cloud provides an open CDN to serve audio files and Quran ayah images to allow you
integrate media into your app. The documentation below explains how to access the media. Please note that the CDN is available over both http and https.
Al Quran Cloud provides an open CDN to serve ayah and surah audio files and Quran ayah images to allow you
integrate media into your app. The documentation below explains how to access the media.
Please note that the CDN is available over both http and https.
</p>

<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<!-- AUDIO BY AYAH -->
<div class="panel panel-primary">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<span class="label label-danger">GET</span> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">Audio - Stream Audio Files
</a>
</h4>
<span class="label label-danger">GET</span>
<a role="button" data-toggle="collapse" data-parent="#accordion"
href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Audio by Ayah
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<h4>CDN</h4>
<h4>Audio files by Ayah</h4>
<p>
This CDN is also referenced in the API responses for audioeditions.
Audio files by ayah are also referenced in the API responses for audio editions via
<a href="https://api.alquran.cloud/v1/edition/format/audio" target="_blank">https://api.alquran.cloud/v1/edition/format/audio</a>.
To use a particular edition for a surah to stream by ayah:
<a href="https://api.alquran.cloud/v1/surah/1/ar.alafasy" target="_blank">https://api.alquran.cloud/v1/surah/1/ar.alafasy</a>.
</p>
<p>
Audio files can be accessed via the following URL:
Ayah audio files can be accessed on the CDN directly via the following URL:
</p>
<code>
https://cdn.islamic.network/quran/audio/{bitrate}/{edition}/{number}.mp3
</code>
<ul>
<li>
{edition} - An audio edition as returned by the API. (Example - ar.alafasy). A list of these editions is available here: <a href="http://api.alquran.cloud/edition/format/audio">http://api.alquran.cloud/edition/format/audio</a>
{edition} - An audio edition as returned by the API. (Example - ar.alafasy). A list
of these editions is available here: <a
href="http://api.alquran.cloud/edition/format/audio">http://api.alquran.cloud/edition/format/audio</a>
</li>
<li>
{number} - An ayah number. the Quran contains 6236 ayahs, so this must be a number between 1 and 6236.
{number} - An ayah number. The Quran contains 6236 ayahs, so this must be a number
between 1 and 6236.
</li>
<li>
{bitrate} - Quality of audio served. Acceptable values are 192, 128, 64, 48, 40 and 32. You can see which edition is available in what sizes at <a href="https://raw.githubusercontent.com/islamic-network/api.alquran.cloud/master/cdn.txt" target="_blank">https://raw.githubusercontent.com/islamic-network/api.alquran.cloud/master/cdn.txt</a>.
{bitrate} - Quality of audio served. Acceptable values are 192, 128, 64, 48, 40 and
32. You can see which edition is available in what sizes at <a
href="https://raw.githubusercontent.com/islamic-network/cdn/master/info/cdn.txt"
target="_blank">https://raw.githubusercontent.com/islamic-network/cdn/master/info/cdn.txt</a>.
</li>
</ul>
<p>
<p>
Examples:
</p>
<ul>
<li><a href="https://cdn.islamic.network/quran/audio/128/ar.alafasy/262.mp3" target="_blank">https://cdn.islamic.network/quran/audio/128/ar.alafasy/262.mp3</a></li>
<li><a href="https://cdn.islamic.network/quran/audio/64/ar.alafasy/262.mp3" target="_blank">https://cdn.islamic.network/quran/audio/64/ar.alafasy/262.mp3</a></li>

<li><a href="https://cdn.islamic.network/quran/audio/128/ar.alafasy/262.mp3"
target="_blank">https://cdn.islamic.network/quran/audio/128/ar.alafasy/262.mp3</a>
</li>
<li><a href="https://cdn.islamic.network/quran/audio/64/ar.alafasy/262.mp3"
target="_blank">https://cdn.islamic.network/quran/audio/64/ar.alafasy/262.mp3</a>
</li>

</ul>

</div>
Expand All @@ -61,43 +79,107 @@
</div>
</div>

<!-- AUDIO BY SURAH -->
<div class="panel panel-primary">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<span class="label label-danger">GET</span>
<a role="button" data-toggle="collapse" data-parent="#accordion"
href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Audio by Surah
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<h4>Audio files by Surah</h4>
<p>
Surah audio files are available to stream via the CDN.
Please note that surah audio files are not integrated with the API as the API deals with with ayah level detail.
Surah audio files can be accessed on the CDN directly via the following URL:
</p>
<code>
https://cdn.islamic.network/quran/audio-surah/128/{edition}/{number}.mp3
</code>

<ul>
<li>
{edition} - An audio edition available on
<a href="https://raw.githubusercontent.com/islamic-network/cdn/master/info/cdn_surah_audio.json">
https://raw.githubusercontent.com/islamic-network/cdn/master/info/cdn_surah_audio.json
</a>. (Example - ar.alafasy).
</li>
<li>
{number} - A surah number. The Quran contains 114 ayahs, so this must be a number
between 1 and 114.
</li>

</ul>
<p>
Examples:
</p>
<ul>
<li><a href="https://cdn.islamic.network/quran/audio-surah/128/ar.alafasy/1.mp3"
target="_blank">https://cdn.islamic.network/quran/audio-surah/128/ar.alafasy/1.mp3</a>
</li>
<li><a href="https://cdn.islamic.network/quran/audio-surah/128/ar.alafasy/114.mp3"
target="_blank">https://cdn.islamic.network/quran/audio-surah/128/ar.alafasy/114.mp3</a>
</li>
</ul>

</div>
</div>
</div>
</div>
</div>

<!-- IMAGES -->
<div class="panel panel-primary">
<div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title">
<span class="label label-danger">GET</span> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">Ayah Images - Get Quran Ayah Images
</a>
</h4>
<span class="label label-danger">GET</span> <a role="button" data-toggle="collapse"
data-parent="#accordion" href="#collapseTwo"
aria-expanded="true" aria-controls="collapseTwo">Ayah
Images - Get Quran Ayah Images
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<p>
Image files can be accessed via the CDN in normal and high resolution using the following URLs:
Image files can be accessed via the CDN in normal and high resolution using the
following URLs:
</p>
<code>
https://cdn.islamic.network/quran/images/{surah}_{ayah}.png
</code>
or
or
<code>
https://cdn.alquran.cloud/media/image/high-resolution/{surah}/{ayah}
</code>
<ul>
<li>
{surah} - A surah number (from 1 to 114)
{surah} - A surah number (from 1 to 114)
</li>
<li>
{ayah} - An ayah number relative to the surah
{ayah} - An ayah number relative to the surah
</li>
</ul>
<p>
Examples:
</p>
<ul>
<li><a href="http://cdn.islamic.network/quran/images/2_255.png" target="_blank">http://cdn.islamic.network/quran/images/2_255.png</a></li>
<li><a href="http://cdn.islamic.network/quran/images/24_35.png" target="_blank">http://cdn.islamic.network/quran/images/24_35.png</a></li>
<li><a href="http://cdn.islamic.network/quran/images/2_255.png" target="_blank">http://cdn.islamic.network/quran/images/2_255.png</a>
</li>
<li><a href="http://cdn.islamic.network/quran/images/24_35.png" target="_blank">http://cdn.islamic.network/quran/images/24_35.png</a>
</li>
<li><a href="http://cdn.islamic.network/quran/images/high-resolution/24_35.png"
target="_blank">http://cdn.islamic.network/quran/images/high-resolution/24_35.png</a></li>
target="_blank">http://cdn.islamic.network/quran/images/high-resolution/24_35.png</a>
</li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions views/common/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<li><a href="/arabic-font-edition-tester">Font Edition Tester</a></li>
</ul>
</li>
<li class="<?= $view == 'cdn' ? 'active' : ''; ?>"><a href="/cdn">CDN</a></li>

</ul>
<form class="navbar-form pull-right" style="margin-right: 20px;" role="search" method="GET" action="/search">
Expand Down

0 comments on commit c24aa7f

Please sign in to comment.