Skip to content

Commit

Permalink
Update to php 8.3 and change audio to ar.afalasy-2 so Bismillah plays…
Browse files Browse the repository at this point in the history
… with the first ayah each fime
  • Loading branch information
meezaan committed Jul 10, 2024
1 parent e661efa commit eaf1003
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM islamicnetwork/php:8.1-apache
FROM islamicnetwork/php:8.3-apache

# Copy files
RUN cd ../ && rm -rf /var/www/html
Expand Down
11 changes: 6 additions & 5 deletions html/public/js/jquery.mediaplayer-ar-en.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ jQuery( document ).ready( function( $ ) {
}
});
if (w.surahChanged === true) {
if (w.surah !=9 && w.surah != 1) {

/* if (w.surah !=9 && w.surah != 1) {
number = 1;
}
}*/
// Update UI
//$('.displayedSurah' + w.surah).removeClass('hide').siblings().addClass('hide');
$('#surahSelector').val(w.surah).trigger('change');
Expand Down Expand Up @@ -86,10 +87,10 @@ jQuery( document ).ready( function( $ ) {
}
}
// console.log(number, w.surah, w.lastAyah);
if (edition == 'ar.alafasy' && w.mode == 'quran') {
if (edition == 'ar.alafasy-2' && w.mode == 'quran') {
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/192/en.walk/' + number + '.mp3');
} else {
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy/' + number + '.mp3');
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/' + number + '.mp3');
}
if (w.player.paused) {
w.player.load();
Expand All @@ -109,7 +110,7 @@ jQuery( document ).ready( function( $ ) {
number = Number($(this).data('number'));
w.realNumber = number;
$('.ayahAudio' + number).addClass('ayah-playing');
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy/' + number + '.mp3');
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/' + number + '.mp3');
w.player.pause();
if (w.player.paused) {
w.player.load();
Expand Down
4 changes: 2 additions & 2 deletions html/public/js/jquery.mediaplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jQuery( document ).ready( function( $ ) {
}
}
//console.log(number, w.surah);
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy/' + number + '.mp3');
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/' + number + '.mp3');
if (w.player.paused) {
w.player.load();
w.player.oncanplaythrough = w.player.play();
Expand All @@ -97,7 +97,7 @@ jQuery( document ).ready( function( $ ) {
number = Number($(this).data('number'));
w.realNumber = number;
$('.ayahAudio' + number).addClass('ayah-playing');
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy/' + number + '.mp3');
$('#activeAyah').attr('src', 'https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/' + number + '.mp3');
w.player.pause();
if (w.player.paused) {
w.player.load();
Expand Down
10 changes: 5 additions & 5 deletions html/public/js/jquery.quran.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jQuery( document ).ready( function( $ ) {
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
if (surah !=1 && surah !=9) {
/* if (surah !=1 && surah !=9) {
player.pause();
// First play bismillah
var bUrl = 'https://cdn.islamic.network/quran/audio/128/ar.alafasy/1.mp3';
var bUrl = 'https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/1.mp3';
$('#activeAyah').attr('src', bUrl)
if (player.paused) {
player.load();
Expand All @@ -54,13 +54,13 @@ jQuery( document ).ready( function( $ ) {
}
});
}
} else {
} else {*/
player.pause();
if (player.paused) {
//var url = 'https://cdn.islamic.network/quran/audio/128/ar.alafasy/' + ayah + '.mp3';
//var url = 'https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/' + ayah + '.mp3';
$("#playThisAyah" + ayah).trigger('click');
}
}

},
monitorEditions: function(element, reference) {
var w = this;
Expand Down
3 changes: 3 additions & 0 deletions src/AlQuranCloud/Renderer/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public static function getLanguages()
"ms" => "Malay",
"zh" => "Chinese",
"si" => "Sinhalese",
"am" => "Amharic",
"ber" => "Berber",
"ps" => "Pashto",
];

asort($a);
Expand Down
2 changes: 1 addition & 1 deletion views/ayah.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<audio id="ayahPlayer" controls="controls" class="align-right">
<source
id="activeAyah"src="https://cdn.islamic.network/quran/audio/128/ar.alafasy/<?=
id="activeAyah"src="https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/<?=
$ayah->data->number; ?>.mp3" title="<?= $ayah->data->number; ?>" type="audio/mp3" />
</audio>
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/juz.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
if ($ayah->surah->number > $currentSurah) {
$currentSurah = $ayah->surah->number; ?>
<?php } ?>
<source id="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy/<?= $ayah->number; ?>.mp3" title="<?= $ayah->number; ?>" type="audio/mp3"/>
<source id="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/<?= $ayah->number; ?>.mp3" title="<?= $ayah->number; ?>" type="audio/mp3"/>
</audio>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/quran.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<audio id="quranPlayer" controls="controls" class="align-right rt">
<source id="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy/1.mp3" title="1" type="audio/mp3"/>
<source id="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/1.mp3" title="1" type="audio/mp3"/>
</audio>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions views/surah.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<audio id="surahPlayer" controls="controls" class="">
<?php if ($surah->data->number > 1 && $surah->data->number != 9) { ?>
<source id ="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy/1.mp3" title="1" type="audio/mp3"/>
<source id ="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/1.mp3" title="1" type="audio/mp3"/>
<?php } else { ?>
<?php $ayah = $surah->data->ayahs[0]; ?>
<source id="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy/<?= $ayah->number; ?>.mp3" title="<?= $ayah->number; ?>" type="audio/mp3"/>
<source id="activeAyah" src="https://cdn.islamic.network/quran/audio/128/ar.alafasy-2/<?= $ayah->number; ?>.mp3" title="<?= $ayah->number; ?>" type="audio/mp3"/>
<?php } ?>
</audio>
</div>
Expand Down

0 comments on commit eaf1003

Please sign in to comment.