Skip to content

Commit

Permalink
FIX: hls player and audio only on apple devices
Browse files Browse the repository at this point in the history
ok, for the likely 0 people who are gonna read this, lets have a quick rant about apple, why do i have to make changes just for my website to work on apples devices when it works on literally every other thing i tried, just for the fix to be such a stupid one like you having to put the mimetype as if it cant just auto detect that, i thaught apple was a multi trillion us dollar company, why cant it spend a tiny little bit more on their software team making the software actually kind of functional jesus christ
  • Loading branch information
GoldDominik893 committed Jun 1, 2024
1 parent 0c0158c commit ca645ee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
14 changes: 7 additions & 7 deletions styles/audioplayer.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
::-webkit-media-controls-enclosure {
border-radius: 0px;
display: revert;
transition: transform 0.2s;
transition: 1.8s;
-webkit-text-stroke: 1px white;
transition: transform 0.2s;
transition: 1.8s;
-webkit-text-stroke: 1px white;
background-color: rgba(0, 0, 0, 0.5);
}

::-webkit-media-controls-enclosure:hover {
border-radius: 0px;
display: revert;
background-color: rgb(31, 31, 31);
transition: transform 0.2s;
transition: 0.3s;
display: revert;
background-color: rgb(31, 31, 31);
transition: transform 0.2s;
transition: 0.3s;
}
2 changes: 1 addition & 1 deletion videodata/hls.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
if ($_GET['itag']) {
$preferredItags = [$_GET['itag']];
} else {
$preferredItags = ['139', '140', '249', '250', '251'];
$preferredItags = ['140', '249', '250', '251', '139'];
}


Expand Down
19 changes: 10 additions & 9 deletions watch/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@


<div class="tenborder">
<center>

<?php
if ($userproxysetting == "on" and $allowProxy = "true") {
$dlsetting = "&dl=true";
Expand All @@ -255,12 +255,13 @@
$videosizingcss = 'style="width: 100%; max-height: 90vh;"';
}
if ($params['listen'] == "true") {

echo '<link rel="stylesheet" href="../styles/audioplayer.css">
<video id="video" class="video-js video" controls preload="auto" data-setup="{}" '.$videosizingcss.' poster="https://i.ytimg.com/vi/'.$params['v'].'/maxresdefault.jpg" autoplay controls>
<source src="/videodata/hls.php?id='.$params['v'].$dlsetting.'" type="audio/webm">
<center><img style="max-height: 60vh; max-width: 100%;" src="https://i.ytimg.com/vi/'.$params['v'].'/maxresdefault.jpg"></center>
<audio preload="auto" '.$videosizingcss.' autoplay controls>
<source src="/videodata/hls.php?id='.$params['v'].$dlsetting.'" type="audio/mp4">
Your Browser Sucks! Can not play the audio.
</video>';
</audio>';
}
else {

Expand All @@ -269,7 +270,7 @@

foreach ($HlsItag as $index => $itag) {
$quality = $HlsQuality[$index];
if ($HlsQuality[$index] === null AND $HlsType[$index] !== null) {
if ($HlsQuality[$index] === null AND $HlsType[$index] !== null AND $HlsType[$index] !== 'webm') {
$audioUrl = str_replace(['{{videoId}}', '{{itag}}'], [$_GET['v'], $itag], $baseUrl);
} else {
$videoUrls[] = [
Expand Down Expand Up @@ -301,8 +302,8 @@
<textarea hidden id="textbox" value="<?php echo $url; ?>"><?php echo $url; ?></textarea>


<h3 style="text-align: center;"> <?php echo $title; ?> <br></h3>
<h4 style="text-align: center;"><?php echo $shared; ?> · <?php echo $views; ?> <?php echo $translations[$langrow]['views']; ?> · <?php echo $likes; ?> <?php echo $translations[$langrow]['likes']; ?><?php echo $dislikes; ?></h4>
<h3><?php echo $title; ?></h3>
<h4><?php echo $shared; ?> · <?php echo $views; ?> <?php echo $translations[$langrow]['views']; ?> · <?php echo $likes; ?> <?php echo $translations[$langrow]['likes']; ?><?php echo $dislikes; ?></h4>

<?php if ($params['listen'] != "true") { ?>
<select class="button" id="qualitySelector"></select>
Expand All @@ -314,7 +315,7 @@
<a class="button" onclick="Alert.render('ok')"><?php echo $translations[$langrow]['download']; ?></a>
<a class="button" onclick="Alert_pl.render('ok')"><?php echo $translations[$langrow]['add_to_playlist']; ?></a>
<a class="button" href="/channel/?id=<?php echo $authorId; ?>"><?php echo $author; ?> · <?php echo $autsubs; ?></a>
</center>


<div id="popUpBox_pl" style="display: none;">
<div id="box_pl">
Expand Down

0 comments on commit ca645ee

Please sign in to comment.