Update index.html
Browse files- index.html +322 -293
index.html
CHANGED
|
@@ -1,127 +1,160 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="ar" dir="rtl">
|
| 3 |
<head>
|
| 4 |
-
<
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
s.settings = qlcnr || {};
|
| 10 |
-
s.src = "\/\/quarrelsomebitter.com\/bRXQV.sAdHGZlH0SYJWHcl\/Kejmw9dufZRUNlAkdPPT\/cr1RN\/DJcyweMkzFc\/tpNfzLU\/0UNbztAE0VMvQB";
|
| 11 |
-
s.async = true;
|
| 12 |
-
s.referrerPolicy = 'no-referrer-when-downgrade';
|
| 13 |
-
l.parentNode.insertBefore(s, l);
|
| 14 |
-
})({})
|
| 15 |
-
</script>
|
| 16 |
|
| 17 |
-
<
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
body{margin:0;background:#0d0f12;color:#fff;font-family:Cairo,Arial,sans-serif}
|
| 23 |
-
#iptv-app{max-width:950px;margin:12px auto;padding:14px;background:#15171b;border:1px solid #292d33;border-radius:18px}
|
| 24 |
-
.header{text-align:center;padding:8px 0 16px}
|
| 25 |
-
.header h2{margin:0;color:#d4af37;font-size:23px}
|
| 26 |
-
.header p{margin:7px 0 0;color:#858b94;font-size:12px}
|
| 27 |
-
.sources{display:flex;gap:7px;overflow-x:auto;padding:4px 0 12px;scrollbar-width:none}
|
| 28 |
-
.sources::-webkit-scrollbar{display:none}
|
| 29 |
-
.source-btn{white-space:nowrap;border:1px solid #30353c;background:#20242a;color:#ddd;border-radius:20px;padding:9px 13px;cursor:pointer}
|
| 30 |
-
.source-btn.active{background:#d4af37;color:#111;border-color:#d4af37;font-weight:bold}
|
| 31 |
-
.layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px}
|
| 32 |
-
.player{background:#000;border:1px solid #30343a;border-radius:14px;overflow:hidden;position:sticky;top:10px}
|
| 33 |
-
.player-wrapper{position:relative;width:100%;aspect-ratio:16/9;background:#000}
|
| 34 |
-
video{display:block;width:100%;height:100%;background:#000}
|
| 35 |
-
|
| 36 |
-
/* شارة الإعلان المدمجة فوق الفيديو */
|
| 37 |
-
.ad-badge{position:absolute;top:10px;right:10px;background:rgba(212,175,55,0.9);color:#000;padding:4px 10px;border-radius:6px;font-size:11px;font-weight:bold;z-index:20;display:none}
|
| 38 |
-
|
| 39 |
-
.now{padding:12px;text-align:center;background:#202329;border-top:1px solid #333}
|
| 40 |
-
.now strong{display:block;color:#d4af37;font-size:14px}
|
| 41 |
-
.now small{display:block;color:#777;margin-top:4px}
|
| 42 |
-
.list-box{background:#1b1e23;border:1px solid #30343a;border-radius:14px;display:flex;flex-direction:column;height:620px;overflow:hidden}
|
| 43 |
-
.tools{padding:12px;border-bottom:1px solid #30343a}
|
| 44 |
-
input,select{width:100%;background:#0c0e11;color:#fff;border:1px solid #343941;border-radius:9px;padding:11px;outline:none}
|
| 45 |
-
select{margin-top:8px}
|
| 46 |
-
.list{overflow:auto;flex:1}
|
| 47 |
-
.channel{display:flex;align-items:center;gap:8px;padding:11px 10px;border-bottom:1px solid #292d32;cursor:pointer}
|
| 48 |
-
.channel:hover{background:#24282e}
|
| 49 |
-
.channel-main{min-width:0;flex:1}
|
| 50 |
-
.channel-name{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
| 51 |
-
.channel-cat{color:#777;font-size:10px;margin-top:3px}
|
| 52 |
-
.fav{width:30px;border:0;background:none;color:#777;font-size:18px;cursor:pointer}
|
| 53 |
-
.fav.on{color:#ffd34e}
|
| 54 |
-
.status{padding:15px;text-align:center;color:#777;font-size:12px}
|
| 55 |
-
.count{font-size:11px;color:#777;padding:9px 12px;border-bottom:1px solid #292d32}
|
| 56 |
-
.add-box{margin-top:14px;background:#1b1e23;border:1px solid #30343a;border-radius:14px;padding:12px}
|
| 57 |
-
.add-row{display:flex;gap:7px;margin-top:8px}
|
| 58 |
-
.add-row button{background:#d4af37;color:#111;border:0;border-radius:9px;padding:0 15px;font-weight:bold;cursor:pointer}
|
| 59 |
-
.clear{margin-top:7px;background:#272b31;color:#aaa;border:0;border-radius:8px;padding:7px 10px;cursor:pointer}
|
| 60 |
-
|
| 61 |
-
@media(max-width:760px){
|
| 62 |
-
#iptv-app{margin:0;border-radius:0;border-left:0;border-right:0;min-height:100vh}
|
| 63 |
-
.layout{grid-template-columns:1fr}
|
| 64 |
-
.player{position:relative;top:0}
|
| 65 |
-
.list-box{height:470px}
|
| 66 |
-
.header h2{font-size:20px}
|
| 67 |
-
}
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
}
|
| 75 |
-
.
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
}
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
</head>
|
| 82 |
<body>
|
|
|
|
| 83 |
<div id="iptv-app">
|
| 84 |
|
| 85 |
<div class="header">
|
| 86 |
-
<h2>📺 IPTV World</h2>
|
| 87 |
-
<p>قنوات عالمية
|
| 88 |
</div>
|
| 89 |
|
| 90 |
<div class="sources" id="sources">
|
| 91 |
<button class="source-btn active" data-url="https://iptv-org.github.io/iptv/categories/general.m3u">عام</button>
|
| 92 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/entertainment.m3u">ترفيه</button>
|
| 93 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/movies.m3u">أفلام</button>
|
| 94 |
-
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/series.m3u">مسلسلات</button>
|
| 95 |
-
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/music.m3u">موسيقى</button>
|
| 96 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/sports.m3u">رياضة</button>
|
| 97 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/news.m3u">أخبار</button>
|
| 98 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/kids.m3u">أطفال</button>
|
| 99 |
-
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/documentary.m3u">وثائقي</button>
|
| 100 |
-
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/family.m3u">عائلي</button>
|
| 101 |
<button class="source-btn" data-url="favorites">⭐ المفضلة</button>
|
| 102 |
</div>
|
| 103 |
-
|
| 104 |
<div class="layout">
|
| 105 |
-
<div>
|
| 106 |
-
<div class="player">
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
</div>
|
|
|
|
|
|
|
|
|
|
| 111 |
<div class="now" id="current-channel-info">
|
| 112 |
-
<strong>اختر قناة</strong>
|
| 113 |
-
<small>اضغط على أي قناة ل
|
| 114 |
</div>
|
| 115 |
</div>
|
| 116 |
|
| 117 |
-
<div class="
|
| 118 |
-
<
|
| 119 |
-
<
|
| 120 |
-
|
| 121 |
-
<button onclick="loadCustomM3U()">تشغيل</button>
|
| 122 |
-
</div>
|
| 123 |
-
<button class="clear" onclick="document.getElementById('m3u-url-input').value=''">مسح الرابط</button>
|
| 124 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
</div>
|
| 126 |
|
| 127 |
<div class="list-box">
|
|
@@ -131,188 +164,204 @@ select{margin-top:8px}
|
|
| 131 |
<option value="all">كل الأقسام</option>
|
| 132 |
</select>
|
| 133 |
</div>
|
| 134 |
-
<div class="count" id="count">
|
| 135 |
<div class="list" id="channels-list">
|
| 136 |
-
<div class="status">ا
|
| 137 |
</div>
|
| 138 |
</div>
|
| 139 |
</div>
|
| 140 |
-
|
| 141 |
</div>
|
| 142 |
|
| 143 |
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
|
| 144 |
<script>
|
| 145 |
-
let allChannels=[];
|
| 146 |
-
let favorites=JSON.parse(localStorage.getItem('iptv_favs')||'[]');
|
| 147 |
-
let hls=null;
|
| 148 |
-
let selectedSource='';
|
| 149 |
let currentChannel = null;
|
| 150 |
let adTimer = null;
|
|
|
|
| 151 |
|
| 152 |
-
const
|
| 153 |
|
| 154 |
-
// مح
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
let adVideoUrl = "";
|
| 168 |
-
if (mediaFiles.length > 0) {
|
| 169 |
-
adVideoUrl = mediaFiles[0].textContent.trim();
|
| 170 |
-
}
|
| 171 |
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
video.play().catch(()=>{});
|
| 177 |
-
|
| 178 |
-
// عند انتهاء فيديو الإعلان يتم فتح القناة الحقيقية فوراً
|
| 179 |
-
video.onended = () => {
|
| 180 |
-
badge.style.display = 'none';
|
| 181 |
-
video.onended = null;
|
| 182 |
-
startLiveStream(channel.url);
|
| 183 |
-
};
|
| 184 |
-
} else {
|
| 185 |
-
startLiveStream(channel.url);
|
| 186 |
-
}
|
| 187 |
-
} catch (e) {
|
| 188 |
-
// في حال تعذر جلب الإعلان يفتح البث المباشر فوراً بدون تعطيل
|
| 189 |
-
startLiveStream(channel.url);
|
| 190 |
}
|
|
|
|
|
|
|
|
|
|
| 191 |
}
|
| 192 |
|
| 193 |
-
function
|
| 194 |
const video = document.getElementById('main-video');
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
} else {
|
| 208 |
-
video.src = streamUrl;
|
| 209 |
-
video.play().catch(()=>{});
|
| 210 |
}
|
| 211 |
-
}
|
| 212 |
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
}
|
| 220 |
-
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
}
|
| 222 |
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
|
| 225 |
-
sourceButtons.
|
| 226 |
-
|
| 227 |
-
|
|
|
|
| 228 |
btn.classList.add('active');
|
| 229 |
-
const url=btn.dataset.url;
|
| 230 |
-
if(url==='favorites'){
|
| 231 |
-
selectedSource='favorites';
|
| 232 |
applyFilters();
|
| 233 |
-
}else{
|
| 234 |
-
selectedSource=url;
|
| 235 |
loadM3U(url);
|
| 236 |
}
|
| 237 |
});
|
| 238 |
});
|
| 239 |
|
| 240 |
-
async function loadM3U(url){
|
| 241 |
-
const list=document.getElementById('channels-list');
|
| 242 |
-
list.innerHTML='<div class="status">جاري
|
| 243 |
-
document.getElementById('count').textContent='تحميل...';
|
| 244 |
-
allChannels=[];
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
}
|
| 257 |
-
}
|
| 258 |
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
selectedSource='custom';
|
| 264 |
-
await loadM3U(url);
|
| 265 |
}
|
| 266 |
|
| 267 |
-
function parseM3U(content){
|
| 268 |
-
const lines=content.split(/\r?\n/);
|
| 269 |
-
const result=[];
|
| 270 |
-
let current=null;
|
| 271 |
-
const cats=new Set();
|
| 272 |
|
| 273 |
-
for(const raw of lines){
|
| 274 |
-
const line=raw.trim();
|
| 275 |
if(!line) continue;
|
| 276 |
|
| 277 |
-
if(line.startsWith('#EXTINF:')){
|
| 278 |
-
const comma=line.indexOf(',');
|
| 279 |
-
const name=comma>=0 ? line.slice(comma+1).trim() : 'قناة';
|
| 280 |
-
const
|
| 281 |
-
const
|
| 282 |
-
current={name,category:group
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
current.url=line;
|
| 286 |
result.push(current);
|
| 287 |
-
current=null;
|
| 288 |
}
|
| 289 |
}
|
| 290 |
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
select.appendChild(option);
|
| 299 |
});
|
| 300 |
-
renderChannels(allChannels);
|
| 301 |
}
|
| 302 |
|
| 303 |
-
function applyFilters(){
|
| 304 |
-
let filtered=allChannels;
|
| 305 |
-
const search=document.getElementById('search-channels').value.trim().toLowerCase();
|
| 306 |
-
const category=document.getElementById('category-select').value;
|
| 307 |
|
| 308 |
-
if(selectedSource==='favorites'){
|
| 309 |
-
filtered=allChannels.filter(c=>favorites.includes(c.url));
|
| 310 |
-
}else if(category!=='all'){
|
| 311 |
-
filtered=filtered.filter(c=>c.category===category);
|
| 312 |
}
|
| 313 |
|
| 314 |
-
if(search){
|
| 315 |
-
filtered=filtered.filter(c=>
|
| 316 |
c.name.toLowerCase().includes(search) ||
|
| 317 |
c.category.toLowerCase().includes(search)
|
| 318 |
);
|
|
@@ -321,57 +370,34 @@ function applyFilters(){
|
|
| 321 |
renderChannels(filtered);
|
| 322 |
}
|
| 323 |
|
| 324 |
-
function renderChannels(channels){
|
| 325 |
-
const list=document.getElementById('channels-list');
|
| 326 |
-
|
| 327 |
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
if(!channels.length){
|
| 331 |
-
list.innerHTML='<div class="status">لا توجد قنوات هنا</div>';
|
| 332 |
-
requestAnimationFrame(()=>list.scrollTop=savedScrollTop);
|
| 333 |
return;
|
| 334 |
}
|
| 335 |
|
| 336 |
-
const frag=document.createDocumentFragment();
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
item.className='channel';
|
| 341 |
-
|
| 342 |
-
const fav=document.createElement('button');
|
| 343 |
-
fav.type='button';
|
| 344 |
-
fav.className='fav '+(favorites.includes(ch.url)?'on':'');
|
| 345 |
-
fav.textContent=favorites.includes(ch.url)?'★':'☆';
|
| 346 |
-
fav.title='المفضلة';
|
| 347 |
-
fav.onclick=e=>{
|
| 348 |
-
e.preventDefault();
|
| 349 |
-
e.stopPropagation();
|
| 350 |
-
toggleFav(ch.url);
|
| 351 |
-
};
|
| 352 |
-
|
| 353 |
-
const main=document.createElement('div');
|
| 354 |
-
main.className='channel-main';
|
| 355 |
-
main.setAttribute('role','button');
|
| 356 |
-
main.setAttribute('tabindex','0');
|
| 357 |
-
main.innerHTML='<div class="channel-name">'+escapeHtml(ch.name)+'</div>'+
|
| 358 |
-
'<div class="channel-cat">'+escapeHtml(ch.category)+'</div>';
|
| 359 |
|
| 360 |
-
const
|
| 361 |
-
|
| 362 |
-
|
|
|
|
| 363 |
|
| 364 |
-
main
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
openChannel();
|
| 368 |
-
};
|
| 369 |
|
| 370 |
-
main.
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
};
|
| 376 |
|
| 377 |
item.appendChild(fav);
|
|
@@ -379,40 +405,43 @@ function renderChannels(channels){
|
|
| 379 |
frag.appendChild(item);
|
| 380 |
});
|
| 381 |
|
| 382 |
-
list.innerHTML='';
|
| 383 |
list.appendChild(frag);
|
| 384 |
-
|
| 385 |
-
requestAnimationFrame(()=>list.scrollTop=savedScrollTop);
|
| 386 |
}
|
| 387 |
|
| 388 |
-
function playChan(ch){
|
| 389 |
-
|
| 390 |
-
document.getElementById('current-channel-info').innerHTML=
|
| 391 |
-
'<strong>▶ '+escapeHtml(ch.name)+'</strong><small>'+escapeHtml(ch.category)+'</small>';
|
| 392 |
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 396 |
}
|
| 397 |
|
| 398 |
-
function toggleFav(url){
|
| 399 |
-
if(favorites.includes(url)){
|
| 400 |
-
favorites=favorites.filter(x=>x!==url);
|
| 401 |
-
}else{
|
| 402 |
favorites.push(url);
|
| 403 |
}
|
| 404 |
-
localStorage.setItem('iptv_favs',JSON.stringify(favorites));
|
| 405 |
applyFilters();
|
| 406 |
}
|
| 407 |
|
| 408 |
-
function escapeHtml(value){
|
| 409 |
-
return String(value||'').replace(/[&<>"']/g,char=>({
|
| 410 |
-
'&':'&','<':'<','>':'>','"':'"',"'":'''
|
| 411 |
-
}[char]));
|
| 412 |
}
|
| 413 |
|
| 414 |
-
|
| 415 |
-
loadM3U('https://iptv-org.github.io/iptv/categories/general.m3u');
|
| 416 |
</script>
|
|
|
|
| 417 |
</body>
|
| 418 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="ar" dir="rtl">
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
| 6 |
+
<title>Family TV — Smart Adaptive IPTV</title>
|
| 7 |
+
|
| 8 |
+
<script src="https://eternalwheeled.com/07/d7/3b/07d73ba94a1ff564374c1ea8c20bf8a6.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
<style>
|
| 11 |
+
.post-body, .entry-content, .post, .post-outer {
|
| 12 |
+
padding: 0 !important; margin: 0 !important; border: none !important;
|
| 13 |
+
background: transparent !important; max-width: 100% !important;
|
| 14 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
* { box-sizing: border-box; }
|
| 17 |
+
body { margin: 0; background: #0b0d10; color: #fff; font-family: Cairo, 'Segoe UI', sans-serif; }
|
| 18 |
+
|
| 19 |
+
#iptv-app { max-width: 980px; margin: 8px auto; padding: 14px; background: #13161c; border-radius: 18px; border: 1px solid #232730; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
|
| 20 |
+
|
| 21 |
+
.header { text-align: center; padding: 10px 0 14px; border-bottom: 1px solid #222631; margin-bottom: 12px; }
|
| 22 |
+
.header h2 { margin: 0; color: #f1b931; font-size: 22px; }
|
| 23 |
+
.header p { margin: 4px 0 0; color: #8a909a; font-size: 12px; }
|
| 24 |
+
|
| 25 |
+
.sources { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
|
| 26 |
+
.sources::-webkit-scrollbar { display: none; }
|
| 27 |
+
.source-btn { white-space: nowrap; border: 1px solid #232730; background: #1a1e26; color: #ccc; border-radius: 20px; padding: 8px 16px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
|
| 28 |
+
.source-btn.active { background: #f1b931; color: #000; border-color: #f1b931; font-weight: bold; }
|
| 29 |
+
|
| 30 |
+
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
|
| 31 |
+
.player-section { display: flex; flex-direction: column; gap: 10px; }
|
| 32 |
+
|
| 33 |
+
.player-container { background: #000; border: 1px solid #232730; border-radius: 14px; overflow: hidden; position: relative; }
|
| 34 |
+
video { display: block; width: 100%; aspect-ratio: 16/9; background: #000; }
|
| 35 |
+
|
| 36 |
+
.instream-ad-overlay {
|
| 37 |
+
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
|
| 38 |
+
background: rgba(10, 12, 16, 0.96); display: none; flex-direction: column;
|
| 39 |
+
justify-content: center; align-items: center; z-index: 100; text-align: center; padding: 20px;
|
| 40 |
+
}
|
| 41 |
+
.ad-badge { position: absolute; top: 12px; right: 12px; background: #f1b931; color: #000; font-size: 10px; font-weight: bold; padding: 3px 8px; border-radius: 4px; }
|
| 42 |
+
|
| 43 |
+
.ad-card-box {
|
| 44 |
+
background: #181c24; border: 1px solid #2f3542; border-radius: 12px; padding: 22px 18px; width: 90%; max-width: 340px;
|
| 45 |
+
box-shadow: 0 8px 24px rgba(0,0,0,0.6); display: flex; flex-direction: column; gap: 12px; align-items: center;
|
| 46 |
+
}
|
| 47 |
+
.ad-card-box h3 { margin: 0; font-size: 15px; color: #f1b931; }
|
| 48 |
+
.ad-card-box p { margin: 0; font-size: 11px; color: #a4b0be; line-height: 1.4; }
|
| 49 |
+
.ad-click-btn {
|
| 50 |
+
background: #2ed573; color: #fff; border: none; padding: 11px 20px; border-radius: 22px;
|
| 51 |
+
font-size: 13px; font-weight: bold; cursor: pointer; width: 100%; text-decoration: none; display: block;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.skip-ad-btn {
|
| 55 |
+
position: absolute; bottom: 18px; left: 18px;
|
| 56 |
+
background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.3);
|
| 57 |
+
padding: 7px 15px; border-radius: 20px; font-size: 11px; font-weight: bold;
|
| 58 |
+
cursor: not-allowed; transition: all 0.2s; z-index: 101;
|
| 59 |
+
}
|
| 60 |
+
.skip-ad-btn.ready { background: #f1b931; color: #000; border-color: #f1b931; cursor: pointer; }
|
| 61 |
+
|
| 62 |
+
.now { padding: 10px; text-align: center; background: #181c24; border-top: 1px solid #232730; }
|
| 63 |
+
.now strong { display: block; color: #f1b931; font-size: 13px; }
|
| 64 |
+
.now small { color: #8a909a; font-size: 11px; }
|
| 65 |
+
|
| 66 |
+
.server-controls { display: flex; gap: 8px; justify-content: center; background: #181c24; padding: 8px; border: 1px solid #232730; border-radius: 10px; }
|
| 67 |
+
.server-btn { background: #222732; border: 1px solid #2f3542; color: #e2e8f0; font-size: 11px; padding: 6px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; transition: all 0.2s; }
|
| 68 |
+
.server-btn:hover { border-color: #f1b931; color: #f1b931; }
|
| 69 |
+
|
| 70 |
+
.dynamic-ad-ticker {
|
| 71 |
+
background: #181c24; border: 1px solid #2f3542; border-radius: 12px; padding: 12px 16px;
|
| 72 |
+
display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; text-decoration: none; transition: all 0.2s ease;
|
| 73 |
+
}
|
| 74 |
+
.dynamic-ad-ticker:hover { border-color: #f1b931; }
|
| 75 |
+
.ticker-badge { background: #f1b931; color: #000; font-size: 10px; font-weight: bold; padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
|
| 76 |
+
.ticker-text { font-size: 12px; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: right; }
|
| 77 |
+
.ticker-text span { color: #f1b931; font-weight: bold; }
|
| 78 |
+
.ticker-action { font-size: 11px; color: #2ed573; font-weight: bold; white-space: nowrap; background: rgba(46, 213, 115, 0.12); padding: 5px 10px; border-radius: 6px; }
|
| 79 |
+
|
| 80 |
+
.list-box { background: #181c24; border: 1px solid #232730; border-radius: 14px; display: flex; flex-direction: column; height: 560px; overflow: hidden; }
|
| 81 |
+
.tools { padding: 10px; border-bottom: 1px solid #232730; }
|
| 82 |
+
input, select { width: 100%; background: #0e1014; color: #fff; border: 1px solid #232730; border-radius: 9px; padding: 9px; outline: none; font-size: 12px; }
|
| 83 |
+
select { margin-top: 6px; }
|
| 84 |
+
.list { overflow-y: auto; flex: 1; }
|
| 85 |
+
.channel { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #222631; cursor: pointer; }
|
| 86 |
+
.channel:hover { background: #212630; }
|
| 87 |
+
.channel-main { min-width: 0; flex: 1; }
|
| 88 |
+
.channel-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
| 89 |
+
.channel-cat { color: #8a909a; font-size: 10px; margin-top: 3px; }
|
| 90 |
+
.fav { width: 28px; border: 0; background: none; color: #8a909a; font-size: 16px; cursor: pointer; }
|
| 91 |
+
.fav.on { color: #f1b931; }
|
| 92 |
+
.status { padding: 20px; text-align: center; color: #8a909a; font-size: 12px; }
|
| 93 |
+
.count { font-size: 11px; color: #8a909a; padding: 8px 12px; border-bottom: 1px solid #232730; }
|
| 94 |
+
|
| 95 |
+
@media(max-width:760px){
|
| 96 |
+
#iptv-app { margin: 0; border-radius: 0; border: none; min-height: 100vh; }
|
| 97 |
+
.layout { grid-template-columns: 1fr; }
|
| 98 |
+
.list-box { height: 440px; }
|
| 99 |
+
}
|
| 100 |
+
</style>
|
| 101 |
</head>
|
| 102 |
<body>
|
| 103 |
+
|
| 104 |
<div id="iptv-app">
|
| 105 |
|
| 106 |
<div class="header">
|
| 107 |
+
<h2>📺 Family TV — IPTV World Premium</h2>
|
| 108 |
+
<p>البث المباشر للقنوات العالمية والرياضية بأعلى جودة</p>
|
| 109 |
</div>
|
| 110 |
|
| 111 |
<div class="sources" id="sources">
|
| 112 |
<button class="source-btn active" data-url="https://iptv-org.github.io/iptv/categories/general.m3u">عام</button>
|
| 113 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/entertainment.m3u">ترفيه</button>
|
| 114 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/movies.m3u">أفلام</button>
|
|
|
|
|
|
|
| 115 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/sports.m3u">رياضة</button>
|
| 116 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/news.m3u">أخبار</button>
|
| 117 |
<button class="source-btn" data-url="https://iptv-org.github.io/iptv/categories/kids.m3u">أطفال</button>
|
|
|
|
|
|
|
| 118 |
<button class="source-btn" data-url="favorites">⭐ المفضلة</button>
|
| 119 |
</div>
|
| 120 |
+
|
| 121 |
<div class="layout">
|
| 122 |
+
<div class="player-section">
|
| 123 |
+
<div class="player-container" id="player-box">
|
| 124 |
+
|
| 125 |
+
<div class="instream-ad-overlay" id="instream-ad">
|
| 126 |
+
<span class="ad-badge">تحديث السيرفر Ad</span>
|
| 127 |
+
|
| 128 |
+
<div class="ad-card-box">
|
| 129 |
+
<h3 id="ad-title-text">⚡ جاري تجهيز السيرفر...</h3>
|
| 130 |
+
<p id="ad-desc-text">اضغط على الزر بالأسفل لضمان تشغيل البث المباشر بدون تقطيع</p>
|
| 131 |
+
<a href="https://asiafilm.org/4/d0e355a77df4d0f9a5ae1e03257d6ab9" id="ad-action-link" target="_blank" class="ad-click-btn" onclick="registerAdClick()">▶ تفعيل السيرفر والسماح بالبث</a>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<button class="skip-ad-btn" id="skip-btn" onclick="skipInStreamAd()">يمكنك التخطي بعد 5</button>
|
| 135 |
</div>
|
| 136 |
+
|
| 137 |
+
<video id="main-video" controls playsinline></video>
|
| 138 |
+
|
| 139 |
<div class="now" id="current-channel-info">
|
| 140 |
+
<strong>اختر قناة للبدء</strong>
|
| 141 |
+
<small>اضغط على أي قناة من القائمة المجاورة</small>
|
| 142 |
</div>
|
| 143 |
</div>
|
| 144 |
|
| 145 |
+
<div class="server-controls">
|
| 146 |
+
<a href="https://asiafilm.org/4/d0e355a77df4d0f9a5ae1e03257d6ab9" target="_blank" class="server-btn">⚡ سيرفر HD رئيسي</a>
|
| 147 |
+
<a href="https://asiafilm.org/4/d0e355a77df4d0f9a5ae1e03257d6ab9" target="_blank" class="server-btn">🚀 سيرفر احتياطي (Fast)</a>
|
| 148 |
+
<a href="https://asiafilm.org/4/d0e355a77df4d0f9a5ae1e03257d6ab9" target="_blank" class="server-btn">🔊 تفعيل الصوت والجودة</a>
|
|
|
|
|
|
|
|
|
|
| 149 |
</div>
|
| 150 |
+
|
| 151 |
+
<a href="https://asiafilm.org/4/d0e355a77df4d0f9a5ae1e03257d6ab9" target="_blank" class="dynamic-ad-ticker" id="dynamic-ticker">
|
| 152 |
+
<span class="ticker-badge">تنبيه البث ⚡</span>
|
| 153 |
+
<div class="ticker-text" id="ticker-text-content">
|
| 154 |
+
مشاهدة ممتعة على قناة <span>Family TV</span> — اضغط هنا لتفعيل سيرفر البث السريع بدون تقطيع
|
| 155 |
+
</div>
|
| 156 |
+
<div class="ticker-action">تفعيل الآن</div>
|
| 157 |
+
</a>
|
| 158 |
</div>
|
| 159 |
|
| 160 |
<div class="list-box">
|
|
|
|
| 164 |
<option value="all">كل الأقسام</option>
|
| 165 |
</select>
|
| 166 |
</div>
|
| 167 |
+
<div class="count" id="count">جاري التجهيز...</div>
|
| 168 |
<div class="list" id="channels-list">
|
| 169 |
+
<div class="status">جاري جلب القنوات...</div>
|
| 170 |
</div>
|
| 171 |
</div>
|
| 172 |
</div>
|
| 173 |
+
|
| 174 |
</div>
|
| 175 |
|
| 176 |
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
|
| 177 |
<script>
|
| 178 |
+
let allChannels = [];
|
| 179 |
+
let favorites = JSON.parse(localStorage.getItem('iptv_favs') || '[]');
|
| 180 |
+
let hls = null;
|
| 181 |
+
let selectedSource = 'https://iptv-org.github.io/iptv/categories/general.m3u';
|
| 182 |
let currentChannel = null;
|
| 183 |
let adTimer = null;
|
| 184 |
+
let skipCountdown = 5;
|
| 185 |
|
| 186 |
+
const ADSTERRA_DIRECT_LINK = "https://asiafilm.org/4/d0e355a77df4d0f9a5ae1e03257d6ab9";
|
| 187 |
|
| 188 |
+
// قائمة قنوات احتياطية مضمونة لتعمل فوراً إذا واجهت روابط الجلب أي ضغط أو حظر
|
| 189 |
+
const fallbackChannels = [
|
| 190 |
+
{ name: "العربية الحدث (بث مباشر)", category: "أخبار", url: "https://live.alarabiya.net/alarabiya/aldashat.m3u8" },
|
| 191 |
+
{ name: "الجزيرة الإخبارية", category: "أخبار", url: "https://live-hls-web-aje.getaj.net/AJE/03.m3u8" },
|
| 192 |
+
{ name: "فرانس 24 عربي", category: "أخبار", url: "https://f24hls.live.cf.ww.aiv-cdn.net/hls/live/2016335/f24ar_hls/master.m3u8" },
|
| 193 |
+
{ name: "سكاي نيوز عربية", category: "أخبار", url: "https://skynewsarabia.live.hls.adaptive.level3.net/skynewsarabia/index.m3u8" }
|
| 194 |
+
];
|
| 195 |
|
| 196 |
+
function updateTickerAndAds(channel) {
|
| 197 |
+
const tickerEl = document.getElementById('ticker-text-content');
|
| 198 |
+
const tickerLink = document.getElementById('dynamic-ticker');
|
| 199 |
+
|
| 200 |
+
let chName = channel ? channel.name : 'Family TV';
|
| 201 |
+
let chCat = channel ? channel.category.toLowerCase() : '';
|
| 202 |
+
|
| 203 |
+
let adText = `تتابع الآن قناة <span>${chName}</span> — احصل على بث مباشر بدون تقطيع عبر سيرفر VIP المخصص`;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
+
if (chCat.includes('sport') || chCat.includes('رياضة') || chName.toLowerCase().includes('bein') || chName.toLowerCase().includes('sport')) {
|
| 206 |
+
adText = `⚽ تشاهد مباراة على <span>${chName}</span> — اضغط هنا لتحميل تطبيق VPN السريع ومنع تقطيع البث الرياضي`;
|
| 207 |
+
} else if (chCat.includes('movie') || chCat.includes('film') || chCat.includes('أفلام')) {
|
| 208 |
+
adText = `🎬 استمتع بالأفلام على <span>${chName}</span> — اشتراك سيرفر الأفلام والمسلسلات بجودة 4K`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
+
|
| 211 |
+
tickerEl.innerHTML = adText;
|
| 212 |
+
tickerLink.href = ADSTERRA_DIRECT_LINK;
|
| 213 |
}
|
| 214 |
|
| 215 |
+
setInterval(function() {
|
| 216 |
const video = document.getElementById('main-video');
|
| 217 |
+
if(!video.paused && currentChannel) {
|
| 218 |
+
showInStreamAd();
|
| 219 |
+
}
|
| 220 |
+
}, 480000);
|
| 221 |
|
| 222 |
+
function showInStreamAd() {
|
| 223 |
+
const overlay = document.getElementById('instream-ad');
|
| 224 |
+
const skipBtn = document.getElementById('skip-btn');
|
| 225 |
+
|
| 226 |
+
if (currentChannel) {
|
| 227 |
+
document.getElementById('ad-title-text').innerText = `⚡ سيرفر خاص لقناة ${currentChannel.name}`;
|
| 228 |
+
document.getElementById('ad-desc-text').innerText = 'اضغط لضمان تشغيل البث بأعلى سرعة وبدون تقطيع';
|
|
|
|
|
|
|
|
|
|
| 229 |
}
|
|
|
|
| 230 |
|
| 231 |
+
overlay.style.display = 'flex';
|
| 232 |
+
skipCountdown = 5;
|
| 233 |
+
skipBtn.classList.remove('ready');
|
| 234 |
+
skipBtn.innerText = `يمكنك التخطي بعد ${skipCountdown}`;
|
| 235 |
+
|
| 236 |
+
if(adTimer) clearInterval(adTimer);
|
| 237 |
+
adTimer = setInterval(function() {
|
| 238 |
+
skipCountdown--;
|
| 239 |
+
if(skipCountdown > 0) {
|
| 240 |
+
skipBtn.innerText = `يمكنك التخطي بعد ${skipCountdown}`;
|
| 241 |
+
} else {
|
| 242 |
+
clearInterval(adTimer);
|
| 243 |
+
skipBtn.innerText = "تخطي الإعلان ⏭";
|
| 244 |
+
skipBtn.classList.add('ready');
|
| 245 |
}
|
| 246 |
+
}, 1000);
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
function registerAdClick() {
|
| 250 |
+
skipCountdown = 0;
|
| 251 |
+
const skipBtn = document.getElementById('skip-btn');
|
| 252 |
+
skipBtn.innerText = "تخطي الإعلان ⏭";
|
| 253 |
+
skipBtn.classList.add('ready');
|
| 254 |
}
|
| 255 |
|
| 256 |
+
function skipInStreamAd() {
|
| 257 |
+
if(skipCountdown <= 0) {
|
| 258 |
+
document.getElementById('instream-ad').style.display = 'none';
|
| 259 |
+
}
|
| 260 |
+
}
|
| 261 |
|
| 262 |
+
const sourceButtons = document.querySelectorAll('.source-btn');
|
| 263 |
+
sourceButtons.forEach(btn => {
|
| 264 |
+
btn.addEventListener('click', () => {
|
| 265 |
+
sourceButtons.forEach(x => x.classList.remove('active'));
|
| 266 |
btn.classList.add('active');
|
| 267 |
+
const url = btn.dataset.url;
|
| 268 |
+
if(url === 'favorites') {
|
| 269 |
+
selectedSource = 'favorites';
|
| 270 |
applyFilters();
|
| 271 |
+
} else {
|
| 272 |
+
selectedSource = url;
|
| 273 |
loadM3U(url);
|
| 274 |
}
|
| 275 |
});
|
| 276 |
});
|
| 277 |
|
| 278 |
+
async function loadM3U(url) {
|
| 279 |
+
const list = document.getElementById('channels-list');
|
| 280 |
+
list.innerHTML = '<div class="status">جاري جلب القنوات...</div>';
|
| 281 |
+
document.getElementById('count').textContent = 'تحميل...';
|
| 282 |
+
allChannels = [];
|
| 283 |
+
|
| 284 |
+
const proxies = [
|
| 285 |
+
url,
|
| 286 |
+
'https://api.allorigins.win/raw?url=' + encodeURIComponent(url),
|
| 287 |
+
'https://corsproxy.io/?' + encodeURIComponent(url)
|
| 288 |
+
];
|
| 289 |
+
|
| 290 |
+
for (let pUrl of proxies) {
|
| 291 |
+
try {
|
| 292 |
+
const response = await fetch(pUrl, {cache: 'no-store'});
|
| 293 |
+
if(!response.ok) continue;
|
| 294 |
+
const data = await response.text();
|
| 295 |
+
if(data && data.includes('#EXTINF')) {
|
| 296 |
+
parseM3U(data);
|
| 297 |
+
return;
|
| 298 |
+
}
|
| 299 |
+
} catch(e) {}
|
| 300 |
}
|
|
|
|
| 301 |
|
| 302 |
+
// استخدام القنوات الاحتياطية في حال تعذر الاتصال بجميع البروكسيات
|
| 303 |
+
allChannels = fallbackChannels;
|
| 304 |
+
updateCategories(allChannels);
|
| 305 |
+
renderChannels(allChannels);
|
|
|
|
|
|
|
| 306 |
}
|
| 307 |
|
| 308 |
+
function parseM3U(content) {
|
| 309 |
+
const lines = content.split(/\r?\n/);
|
| 310 |
+
const result = [];
|
| 311 |
+
let current = null;
|
|
|
|
| 312 |
|
| 313 |
+
for(const raw of lines) {
|
| 314 |
+
const line = raw.trim();
|
| 315 |
if(!line) continue;
|
| 316 |
|
| 317 |
+
if(line.startsWith('#EXTINF:')) {
|
| 318 |
+
const comma = line.indexOf(',');
|
| 319 |
+
const name = comma >= 0 ? line.slice(comma+1).trim() : 'قناة';
|
| 320 |
+
const groupMatch = line.match(/group-title="([^"]*)"/i);
|
| 321 |
+
const group = groupMatch ? groupMatch[1] : 'عام';
|
| 322 |
+
current = {name, category: group};
|
| 323 |
+
} else if(current && !line.startsWith('#') && /^https?:\/\//i.test(line)) {
|
| 324 |
+
current.url = line;
|
|
|
|
| 325 |
result.push(current);
|
| 326 |
+
current = null;
|
| 327 |
}
|
| 328 |
}
|
| 329 |
|
| 330 |
+
if (result.length === 0) {
|
| 331 |
+
allChannels = fallbackChannels;
|
| 332 |
+
} else {
|
| 333 |
+
allChannels = result;
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
updateCategories(allChannels);
|
| 337 |
+
renderChannels(allChannels);
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
function updateCategories(channels) {
|
| 341 |
+
const cats = new Set(channels.map(c => c.category));
|
| 342 |
+
const select = document.getElementById('category-select');
|
| 343 |
+
select.innerHTML = '<option value="all">كل الأقسام</option>';
|
| 344 |
+
[...cats].sort().forEach(cat => {
|
| 345 |
+
const option = document.createElement('option');
|
| 346 |
+
option.value = cat;
|
| 347 |
+
option.textContent = cat;
|
| 348 |
select.appendChild(option);
|
| 349 |
});
|
|
|
|
| 350 |
}
|
| 351 |
|
| 352 |
+
function applyFilters() {
|
| 353 |
+
let filtered = allChannels;
|
| 354 |
+
const search = document.getElementById('search-channels').value.trim().toLowerCase();
|
| 355 |
+
const category = document.getElementById('category-select').value;
|
| 356 |
|
| 357 |
+
if(selectedSource === 'favorites') {
|
| 358 |
+
filtered = allChannels.filter(c => favorites.includes(c.url));
|
| 359 |
+
} else if(category !== 'all') {
|
| 360 |
+
filtered = filtered.filter(c => c.category === category);
|
| 361 |
}
|
| 362 |
|
| 363 |
+
if(search) {
|
| 364 |
+
filtered = filtered.filter(c =>
|
| 365 |
c.name.toLowerCase().includes(search) ||
|
| 366 |
c.category.toLowerCase().includes(search)
|
| 367 |
);
|
|
|
|
| 370 |
renderChannels(filtered);
|
| 371 |
}
|
| 372 |
|
| 373 |
+
function renderChannels(channels) {
|
| 374 |
+
const list = document.getElementById('channels-list');
|
| 375 |
+
document.getElementById('count').textContent = 'عدد القنوات: ' + channels.length;
|
| 376 |
|
| 377 |
+
if(!channels.length) {
|
| 378 |
+
list.innerHTML = '<div class="status">لا توجد قنوات</div>';
|
|
|
|
|
|
|
|
|
|
| 379 |
return;
|
| 380 |
}
|
| 381 |
|
| 382 |
+
const frag = document.createDocumentFragment();
|
| 383 |
+
channels.forEach((ch) => {
|
| 384 |
+
const item = document.createElement('div');
|
| 385 |
+
item.className = 'channel';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
|
| 387 |
+
const fav = document.createElement('button');
|
| 388 |
+
fav.className = 'fav ' + (favorites.includes(ch.url) ? 'on' : '');
|
| 389 |
+
fav.textContent = favorites.includes(ch.url)?'★':'☆';
|
| 390 |
+
fav.onclick = e => { e.stopPropagation(); toggleFav(ch.url); };
|
| 391 |
|
| 392 |
+
const main = document.createElement('div');
|
| 393 |
+
main.className = 'channel-main';
|
| 394 |
+
main.innerHTML = `<div class="channel-name">${escapeHtml(ch.name)}</div><div class="channel-cat">${escapeHtml(ch.category)}</div>`;
|
|
|
|
|
|
|
| 395 |
|
| 396 |
+
main.onclick = () => {
|
| 397 |
+
currentChannel = ch;
|
| 398 |
+
updateTickerAndAds(ch);
|
| 399 |
+
showInStreamAd();
|
| 400 |
+
playChan(ch);
|
| 401 |
};
|
| 402 |
|
| 403 |
item.appendChild(fav);
|
|
|
|
| 405 |
frag.appendChild(item);
|
| 406 |
});
|
| 407 |
|
| 408 |
+
list.innerHTML = '';
|
| 409 |
list.appendChild(frag);
|
|
|
|
|
|
|
| 410 |
}
|
| 411 |
|
| 412 |
+
function playChan(ch) {
|
| 413 |
+
const video = document.getElementById('main-video');
|
| 414 |
+
document.getElementById('current-channel-info').innerHTML = `<strong>▶ ${escapeHtml(ch.name)}</strong><small>${escapeHtml(ch.category)}</small>`;
|
|
|
|
| 415 |
|
| 416 |
+
if(hls) { hls.destroy(); hls = null; }
|
| 417 |
+
|
| 418 |
+
if(window.Hls && Hls.isSupported() && /\.m3u8($|\?)/i.test(ch.url)) {
|
| 419 |
+
hls = new Hls({enableWorker: true});
|
| 420 |
+
hls.loadSource(ch.url);
|
| 421 |
+
hls.attachMedia(video);
|
| 422 |
+
hls.on(Hls.Events.MANIFEST_PARSED, () => { video.play().catch(()=>{}); });
|
| 423 |
+
} else {
|
| 424 |
+
video.src = ch.url;
|
| 425 |
+
video.play().catch(()=>{});
|
| 426 |
+
}
|
| 427 |
}
|
| 428 |
|
| 429 |
+
function toggleFav(url) {
|
| 430 |
+
if(favorites.includes(url)) {
|
| 431 |
+
favorites = favorites.filter(x => x!==url);
|
| 432 |
+
} else {
|
| 433 |
favorites.push(url);
|
| 434 |
}
|
| 435 |
+
localStorage.setItem('iptv_favs', JSON.stringify(favorites));
|
| 436 |
applyFilters();
|
| 437 |
}
|
| 438 |
|
| 439 |
+
function escapeHtml(value) {
|
| 440 |
+
return String(value||'').replace(/[&<>"']/g, char => ({ '&':'&','<':'<','>':'>','"':'"','\039':''' }[char]));
|
|
|
|
|
|
|
| 441 |
}
|
| 442 |
|
| 443 |
+
loadM3U(selectedSource);
|
|
|
|
| 444 |
</script>
|
| 445 |
+
|
| 446 |
</body>
|
| 447 |
</html>
|