File size: 43,411 Bytes
f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 9ec7114 f45c3d5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 |
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CinéFull - Films Complets en HD</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.player-container {
aspect-ratio: 16/9;
}
.loading-spinner {
border-top-color: transparent;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.quality-badge {
position: absolute;
top: 8px;
right: 8px;
background: rgba(0,0,0,0.7);
}
.server-btn.active {
background-color: #3b82f6;
}
.progress-container {
height: 4px;
background-color: #4b5563;
}
.progress-bar {
height: 100%;
background-color: #3b82f6;
width: 0%;
}
.film-controls {
opacity: 0;
transition: opacity 0.3s;
}
.film-container:hover .film-controls {
opacity: 1;
}
.search-dropdown {
max-height: 400px;
overflow-y: auto;
}
.movie-card:hover .movie-overlay {
opacity: 1;
}
.movie-overlay {
transition: all 0.3s ease;
}
.blur-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-size: cover;
filter: blur(20px);
opacity: 0.3;
z-index: -1;
}
.category-btn.active {
background-color: #3b82f6;
color: white;
}
</style>
</head>
<body class="bg-gray-900 text-white">
<!-- Header -->
<header class="bg-gray-800 shadow-lg sticky top-0 z-50">
<div class="container mx-auto px-4 py-3 flex items-center justify-between">
<div class="flex items-center space-x-2">
<i class="fas fa-film text-blue-500 text-2xl"></i>
<h1 class="text-xl font-bold">Ciné<span class="text-blue-500">Full</span></h1>
</div>
<div class="hidden md:flex items-center space-x-6">
<a href="#" class="hover:text-blue-400">Accueil</a>
<a href="#" class="hover:text-blue-400">Films</a>
<a href="#" class="hover:text-blue-400">Séries</a>
<a href="#" class="hover:text-blue-400">Nouveautés</a>
<a href="#" class="hover:text-blue-400">Catégories</a>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" id="search-input" placeholder="Rechercher un film..."
class="bg-gray-700 px-4 py-2 rounded-md w-64 focus:outline-none focus:ring-2 focus:ring-blue-500">
<div id="search-results" class="absolute left-0 mt-2 w-full bg-gray-800 rounded-md shadow-xl search-dropdown hidden z-50"></div>
</div>
<button class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-md">
<i class="fas fa-user mr-2"></i>Connexion
</button>
<button class="md:hidden" id="mobile-menu-btn">
<i class="fas fa-bars text-xl"></i>
</button>
</div>
</div>
</header>
<!-- Mobile Menu -->
<div id="mobile-menu" class="hidden md:hidden bg-gray-800 px-4 py-2">
<div class="flex flex-col space-y-2">
<a href="#" class="hover:text-blue-400 py-1">Accueil</a>
<a href="#" class="hover:text-blue-400 py-1">Films</a>
<a href="#" class="hover:text-blue-400 py-1">Séries</a>
<a href="#" class="hover:text-blue-400 py-1">Nouveautés</a>
<a href="#" class="hover:text-blue-400 py-1">Catégories</a>
</div>
</div>
<!-- Main Content -->
<main class="container mx-auto px-4 py-6">
<!-- Categories Navigation -->
<div class="flex overflow-x-auto pb-4 mb-6 scrollbar-hide">
<div class="flex space-x-2">
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="all">Tous</button>
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="french">Français</button>
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="action">Action</button>
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="comedy">Comédie</button>
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="drama">Drame</button>
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="sf">Science-Fiction</button>
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="horror">Horreur</button>
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="adventure">Aventure</button>
</div>
</div>
<!-- Featured Movie -->
<section class="mb-12">
<div class="relative film-container">
<!-- Background blur effect -->
<div id="movie-backdrop" class="blur-bg"></div>
<!-- Video Player -->
<div class="relative player-container bg-black rounded-lg overflow-hidden shadow-xl">
<div id="full-movie-container">
<div class="flex items-center justify-center h-full bg-gray-800">
<div class="text-center">
<i class="fas fa-film text-5xl text-gray-600 mb-4"></i>
<p class="text-gray-400">Sélectionnez un film pour commencer</p>
</div>
</div>
</div>
<!-- Loading Overlay -->
<div id="loading-overlay" class="absolute inset-0 bg-black bg-opacity-70 flex items-center justify-center hidden">
<div class="w-16 h-16 border-4 border-blue-500 border-t-transparent rounded-full loading-spinner"></div>
<span class="ml-3">Chargement du film...</span>
</div>
<!-- Controls Overlay -->
<div class="film-controls absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black to-transparent p-4">
<div class="progress-container mb-2">
<div id="progress-bar" class="progress-bar"></div>
</div>
<div class="flex justify-between items-center">
<div class="flex items-center space-x-4">
<button id="play-pause-btn" class="text-white hover:text-blue-400">
<i class="fas fa-pause text-xl"></i>
</button>
<span id="current-time" class="text-sm">00:00</span>
<span class="text-gray-400">/</span>
<span id="duration" class="text-sm">00:00</span>
</div>
<div class="flex items-center space-x-4">
<button id="mute-btn" class="text-white hover:text-blue-400">
<i class="fas fa-volume-up text-xl"></i>
</button>
<button class="text-white hover:text-blue-400">
<i class="fas fa-closed-captioning text-xl"></i>
</button>
<button onclick="toggleFullscreen('full-movie')" class="text-white hover:text-blue-400">
<i class="fas fa-expand text-xl"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Movie Info -->
<div id="movie-info-container" class="mt-6 bg-gray-800 bg-opacity-80 rounded-lg p-6 backdrop-blur-sm hidden">
<div class="flex flex-col md:flex-row gap-6">
<div class="flex-shrink-0">
<img id="current-movie-poster" src="" alt="" class="w-48 rounded-lg shadow-md">
</div>
<div class="flex-grow">
<h2 id="current-movie-title" class="text-3xl font-bold mb-2"></h2>
<div class="flex items-center mb-4">
<div id="current-movie-rating" class="flex text-yellow-400 mr-3"></div>
<span id="current-movie-rating-value" class="mr-4"></span>
<span id="current-movie-quality" class="px-2 py-1 bg-blue-600 rounded text-xs mr-2"></span>
<span id="current-movie-duration" class="text-gray-400"></span>
</div>
<p id="current-movie-description" class="text-gray-300 mb-4"></p>
<div id="current-movie-genres" class="flex flex-wrap gap-2 mb-6"></div>
<div class="flex items-center space-x-4">
<button class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-md flex items-center">
<i class="fas fa-bookmark mr-2"></i> Ajouter à ma liste
</button>
<button class="bg-gray-700 hover:bg-gray-600 px-4 py-2 rounded-md flex items-center">
<i class="fas fa-share-alt mr-2"></i> Partager
</button>
</div>
</div>
</div>
<!-- Server Selection -->
<div class="mt-8">
<h3 class="text-xl font-bold mb-4">Serveurs Disponibles</h3>
<div id="server-buttons" class="flex flex-wrap gap-3"></div>
</div>
</div>
</div>
</section>
<!-- Movie Categories -->
<section class="mb-12">
<h2 class="text-2xl font-bold mb-6 flex items-center">
<i class="fas fa-fire text-red-500 mr-2"></i> Films Tendances
</h2>
<div id="trending-movies" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
<!-- Movies will be loaded here -->
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
</div>
</section>
<section class="mb-12">
<h2 class="text-2xl font-bold mb-6 flex items-center">
<i class="fas fa-star text-yellow-500 mr-2"></i> Meilleurs Films
</h2>
<div id="top-rated-movies" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
<!-- Movies will be loaded here -->
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
</div>
</section>
<section class="mb-12">
<h2 class="text-2xl font-bold mb-6 flex items-center">
<i class="fas fa-clock text-blue-500 mr-2"></i> Nouveaux Films
</h2>
<div id="new-releases" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
<!-- Movies will be loaded here -->
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="bg-gray-900 pt-12 pb-6">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8">
<div>
<h3 class="text-xl font-bold mb-4 flex items-center">
<i class="fas fa-film text-blue-500 mr-2"></i> CinéFull
</h3>
<p class="text-gray-400 mb-4">La meilleure plateforme pour regarder des films complets en streaming gratuit.</p>
<div class="flex space-x-4">
<a href="#" class="text-gray-400 hover:text-blue-400">
<i class="fab fa-facebook-f"></i>
</a>
<a href="#" class="text-gray-400 hover:text-blue-400">
<i class="fab fa-twitter"></i>
</a>
<a href="#" class="text-gray-400 hover:text-blue-400">
<i class="fab fa-telegram"></i>
</a>
</div>
</div>
<div>
<h4 class="font-bold mb-4">Navigation</h4>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-blue-400">Accueil</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">Films</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">Séries</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">Nouveautés</a></li>
</ul>
</div>
<div>
<h4 class="font-bold mb-4">Catégories</h4>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-blue-400">Action</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">Science-fiction</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">Drame</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">Aventure</a></li>
</ul>
</div>
<div>
<h4 class="font-bold mb-4">Légal</h4>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-blue-400">Mentions légales</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">CGU</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">DMCA</a></li>
<li><a href="#" class="text-gray-400 hover:text-blue-400">Contact</a></li>
</ul>
</div>
</div>
<div class="pt-6 border-t border-gray-800 text-center text-gray-500 text-sm">
<p>© 2023 CinéFull. Tous droits réservés.</p>
<p class="mt-2">Ce site fournit des liens vers des serveurs externes.</p>
</div>
</div>
</footer>
<script>
// Configuration de l'API
const API_CONFIG = {
baseUrl: 'https://api.themoviedb.org/3',
apiKey: '6a4bf6d8e5a9c7f7a9a9a9a9a9a9a9a9', // Remplacez par votre clé API TMDB
language: 'fr-FR',
region: 'FR'
};
// Proxy pour contourner le CORS (à utiliser en développement seulement)
const CORS_PROXY = 'https://cors-anywhere.herokuapp.com/';
// Base de données locale pour stocker les films avec leurs liens
let movieDatabase = [];
// Toggle fullscreen mode
function toggleFullscreen(videoId) {
const video = document.getElementById(videoId);
if (!document.fullscreenElement) {
video.requestFullscreen().catch(err => {
alert(`Erreur lors du passage en plein écran: ${err.message}`);
});
} else {
document.exitFullscreen();
}
}
// Change server
function changeServer(src, serverName) {
const videoContainer = document.getElementById('full-movie-container');
const loadingOverlay = document.getElementById('loading-overlay');
// Show loading
loadingOverlay.classList.remove('hidden');
// Reset all server buttons
document.querySelectorAll('.server-btn').forEach(btn => {
btn.classList.remove('active');
btn.classList.add('bg-gray-700', 'hover:bg-gray-600');
});
// Set active server button
event.target.classList.add('active');
event.target.classList.remove('bg-gray-700', 'hover:bg-gray-600');
// Create new iframe for the video
let videoHTML;
if (src.includes('youtube.com') || src.includes('youtu.be')) {
const videoId = src.includes('youtube.com')
? src.match(/[?&]v=([^&]+)/)[1]
: src.match(/youtu.be\/([^?]+)/)[1];
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.youtube.com/embed/${videoId}?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`;
} else if (src.includes('vimeo.com')) {
const videoId = src.match(/vimeo.com\/(\d+)/)[1];
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://player.vimeo.com/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`;
} else if (src.includes('dailymotion.com')) {
const videoId = src.match(/video\/([^_]+)/)[1];
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.dailymotion.com/embed/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay" allowfullscreen></iframe>`;
} else {
videoHTML = `<video id="full-movie" class="w-full h-full" autoplay muted controls>
<source src="${src}" type="video/mp4">
Votre navigateur ne supporte pas la lecture de vidéos.
</video>`;
}
// Replace video content
videoContainer.innerHTML = videoHTML;
// Hide loading after a delay
setTimeout(() => {
loadingOverlay.classList.add('hidden');
// Re-attach event listeners if it's a video element
const newVideo = document.getElementById('full-movie');
if (newVideo.tagName === 'VIDEO') {
setupVideoControls(newVideo);
}
}, 1500);
}
// Setup video controls for HTML5 video
function setupVideoControls(video) {
const playPauseBtn = document.getElementById('play-pause-btn');
const currentTime = document.getElementById('current-time');
const duration = document.getElementById('duration');
const progressBar = document.getElementById('progress-bar');
const muteBtn = document.getElementById('mute-btn');
// Format time
function formatTime(seconds) {
const minutes = Math.floor(seconds / 60);
const remainingSeconds = Math.floor(seconds % 60);
return `${minutes}:${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;
}
// Update time display
function updateTime() {
currentTime.textContent = formatTime(video.currentTime);
duration.textContent = formatTime(video.duration);
// Update progress bar
const progress = (video.currentTime / video.duration) * 100;
progressBar.style.width = `${progress}%`;
}
// Toggle play/pause
playPauseBtn.addEventListener('click', function() {
if (video.paused) {
video.play();
playPauseBtn.innerHTML = '<i class="fas fa-pause text-xl"></i>';
} else {
video.pause();
playPauseBtn.innerHTML = '<i class="fas fa-play text-xl"></i>';
}
});
// Toggle mute
muteBtn.addEventListener('click', function() {
video.muted = !video.muted;
muteBtn.innerHTML = video.muted
? '<i class="fas fa-volume-mute text-xl"></i>'
: '<i class="fas fa-volume-up text-xl"></i>';
});
// Update time on timeupdate
video.addEventListener('timeupdate', updateTime);
// Update duration when metadata is loaded
video.addEventListener('loadedmetadata', function() {
duration.textContent = formatTime(video.duration);
});
// Click on progress bar to seek
document.querySelector('.progress-container').addEventListener('click', function(e) {
const rect = this.getBoundingClientRect();
const pos = (e.pageX - rect.left) / this.offsetWidth;
video.currentTime = pos * video.duration;
});
// Auto-play video with muted sound (to bypass browser restrictions)
video.muted = true;
video.play().catch(e => {
console.log('Autoplay prevented, showing controls');
video.controls = true;
});
// Toggle play/pause icon when video is played/paused
video.addEventListener('play', function() {
playPauseBtn.innerHTML = '<i class="fas fa-pause text-xl"></i>';
});
video.addEventListener('pause', function() {
playPauseBtn.innerHTML = '<i class="fas fa-play text-xl"></i>';
});
}
// Load movie into player
function loadMovie(movieId) {
const movie = movieDatabase.find(m => m.id === movieId);
if (!movie) return;
// Show movie info container
document.getElementById('movie-info-container').classList.remove('hidden');
// Update movie info
document.getElementById('current-movie-title').textContent = `${movie.title} (${movie.year})`;
document.getElementById('current-movie-poster').src = movie.poster;
document.getElementById('current-movie-poster').alt = movie.title;
document.getElementById('current-movie-description').textContent = movie.description;
document.getElementById('current-movie-duration').textContent = movie.duration;
// Update backdrop
document.getElementById('movie-backdrop').style.backgroundImage = `url(${movie.backdrop})`;
// Update rating stars
const ratingContainer = document.getElementById('current-movie-rating');
ratingContainer.innerHTML = '';
const fullStars = Math.floor(movie.rating);
const hasHalfStar = movie.rating % 1 >= 0.5;
for (let i = 0; i < 5; i++) {
if (i < fullStars) {
ratingContainer.innerHTML += '<i class="fas fa-star"></i>';
} else if (i === fullStars && hasHalfStar) {
ratingContainer.innerHTML += '<i class="fas fa-star-half-alt"></i>';
} else {
ratingContainer.innerHTML += '<i class="far fa-star"></i>';
}
}
// Update rating value
document.getElementById('current-movie-rating-value').textContent = `${movie.rating.toFixed(1)}/5`;
// Update quality
document.getElementById('current-movie-quality').textContent = movie.quality || 'HD 1080p';
// Update genres
const genresContainer = document.getElementById('current-movie-genres');
genresContainer.innerHTML = '';
movie.genres.forEach(genre => {
genresContainer.innerHTML += `<span class="px-3 py-1 bg-gray-700 rounded-full text-sm">${genre.name || genre}</span>`;
});
// Update servers
const serversContainer = document.getElementById('server-buttons');
serversContainer.innerHTML = '';
if (movie.servers && movie.servers.length > 0) {
movie.servers.forEach((server, index) => {
serversContainer.innerHTML += `
<button class="server-btn px-4 py-2 rounded-md flex items-center ${index === 0 ? 'active bg-blue-600' : 'bg-gray-700 hover:bg-gray-600'}"
onclick="changeServer('${server.url}', '${server.name}')">
<i class="fas fa-server mr-2"></i> ${server.name} <span class="ml-2 text-xs bg-black bg-opacity-50 px-2 py-1 rounded">${server.quality || 'HD'}</span>
</button>
`;
});
// Load first server by default with autoplay
const videoContainer = document.getElementById('full-movie-container');
let videoHTML;
if (movie.servers[0].url.includes('youtube.com') || movie.servers[0].url.includes('youtu.be')) {
const videoId = movie.servers[0].url.includes('youtube.com')
? movie.servers[0].url.match(/[?&]v=([^&]+)/)[1]
: movie.servers[0].url.match(/youtu.be\/([^?]+)/)[1];
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.youtube.com/embed/${videoId}?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`;
} else if (movie.servers[0].url.includes('vimeo.com')) {
const videoId = movie.servers[0].url.match(/vimeo.com\/(\d+)/)[1];
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://player.vimeo.com/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`;
} else if (movie.servers[0].url.includes('dailymotion.com')) {
const videoId = movie.servers[0].url.match(/video\/([^_]+)/)[1];
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.dailymotion.com/embed/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay" allowfullscreen></iframe>`;
} else {
videoHTML = `<video id="full-movie" class="w-full h-full" autoplay muted controls>
<source src="${movie.servers[0].url}" type="video/mp4">
Votre navigateur ne supporte pas la lecture de vidéos.
</video>`;
}
videoContainer.innerHTML = videoHTML;
// Setup controls if it's a video element
const video = document.getElementById('full-movie');
if (video.tagName === 'VIDEO') {
setupVideoControls(video);
}
} else {
// No servers available
serversContainer.innerHTML = '<p class="text-gray-400">Aucun serveur disponible pour ce film</p>';
videoContainer.innerHTML = '<div class="flex items-center justify-center h-full bg-gray-800"><p class="text-gray-400">Aucun lien de streaming disponible</p></div>';
}
}
// Create movie card
function createMovieCard(movie) {
return `
<div class="group movie-card" onclick="loadMovie(${movie.id})">
<div class="relative overflow-hidden rounded-lg aspect-[2/3]">
<img src="${movie.poster}" alt="${movie.title}" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300">
<div class="movie-overlay absolute inset-0 bg-black bg-opacity-30 flex items-center justify-center opacity-0">
<button class="bg-blue-600 hover:bg-blue-700 w-12 h-12 rounded-full flex items-center justify-center">
<i class="fas fa-play"></i>
</button>
</div>
<span class="absolute top-2 right-2 bg-yellow-500 text-black text-xs font-bold px-2 py-1 rounded">${movie.rating.toFixed(1)}</span>
</div>
<h4 class="mt-2 font-medium">${movie.title} <span class="text-gray-400">(${movie.year})</span></h4>
</div>
`;
}
// Filter movies by category
function filterMoviesByCategory(category) {
if (category === 'all') return movieDatabase;
const categoryMap = {
'french': m => m.original_language === 'fr',
'action': m => m.genre_ids?.includes(28) || m.genres?.some(g => g.id === 28),
'comedy': m => m.genre_ids?.includes(35) || m.genres?.some(g => g.id === 35),
'drama': m => m.genre_ids?.includes(18) || m.genres?.some(g => g.id === 18),
'sf': m => m.genre_ids?.includes(878) || m.genres?.some(g => g.id === 878),
'horror': m => m.genre_ids?.includes(27) || m.genres?.some(g => g.id === 27),
'adventure': m => m.genre_ids?.includes(12) || m.genres?.some(g => g.id === 12)
};
return movieDatabase.filter(categoryMap[category] || (() => true));
}
// Search movies
function searchMovies(query) {
if (!query) return [];
return movieDatabase.filter(movie =>
movie.title.toLowerCase().includes(query.toLowerCase())
);
}
// Fetch movie streaming links from external API
async function fetchStreamingLinks(movieId, title) {
try {
// En production, vous devriez utiliser votre propre backend pour récupérer les liens
// Ceci est un exemple avec des liens fictifs
// Générer des liens fictifs basés sur le titre du film
const searchQuery = encodeURIComponent(`${title} film complet français`);
// YouTube
const youtubeLink = `https://www.youtube.com/results?search_query=${searchQuery}`;
// Vimeo
const vimeoLink = `https://vimeo.com/search?q=${searchQuery}`;
// Dailymotion
const dailymotionLink = `https://www.dailymotion.com/search/${searchQuery}`;
// Retourner des liens fictifs (en réalité, vous devriez parser les résultats de recherche)
return [
{ name: "YouTube", url: `https://www.youtube.com/embed/zSWdZVtXT7E?autoplay=1`, quality: "HD 1080p" },
{ name: "Vimeo", url: `https://player.vimeo.com/video/24456787?autoplay=1`, quality: "HD 720p" },
{ name: "Dailymotion", url: `https://www.dailymotion.com/embed/video/x8j1j4v?autoplay=1`, quality: "HD 720p" }
];
} catch (error) {
console.error("Error fetching streaming links:", error);
return [];
}
}
// Fetch movies from TMDB API
async function fetchMovies() {
try {
// Fetch trending movies
const trendingResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/trending/movie/week?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}®ion=${API_CONFIG.region}`);
const trendingData = await trendingResponse.json();
// Fetch top rated movies
const topRatedResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/movie/top_rated?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}®ion=${API_CONFIG.region}`);
const topRatedData = await topRatedResponse.json();
// Fetch upcoming movies
const upcomingResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/movie/upcoming?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}®ion=${API_CONFIG.region}`);
const upcomingData = await upcomingResponse.json();
// Combine all movies and remove duplicates
const allMovies = [...trendingData.results, ...topRatedData.results, ...upcomingData.results];
const uniqueMovies = allMovies.filter((movie, index, self) =>
index === self.findIndex(m => m.id === movie.id)
);
// Fetch genres
const genresResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/genre/movie/list?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}`);
const genresData = await genresResponse.json();
const genresMap = genresData.genres.reduce((map, genre) => {
map[genre.id] = genre;
return map;
}, {});
// Process movies and add to database
movieDatabase = await Promise.all(uniqueMovies.map(async (movie) => {
// Get movie details for full description
const detailsResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/movie/${movie.id}?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}`);
const details = await detailsResponse.json();
// Get streaming links
const servers = await fetchStreamingLinks(movie.id, movie.title);
return {
id: movie.id,
title: movie.title,
year: new Date(movie.release_date).getFullYear(),
description: details.overview || "Description non disponible",
poster: movie.poster_path ? `https://image.tmdb.org/t/p/w500${movie.poster_path}` : 'https://via.placeholder.com/500x750?text=Poster+non+disponible',
backdrop: movie.backdrop_path ? `https://image.tmdb.org/t/p/original${movie.backdrop_path}` : 'https://via.placeholder.com/1920x1080?text=Backdrop+non+disponible',
rating: movie.vote_average / 2, // Convert from 10 to 5 star scale
duration: movie.runtime ? `${Math.floor(movie.runtime / 60)}h ${movie.runtime % 60}min` : "Durée inconnue",
genres: movie.genre_ids ? movie.genre_ids.map(id => genresMap[id]) : [],
original_language: movie.original_language,
servers: servers,
trending: trendingData.results.some(m => m.id === movie.id),
topRated: topRatedData.results.some(m => m.id === movie.id)
};
}));
return movieDatabase;
} catch (error) {
console.error("Error fetching movies:", error);
// Fallback to local database if API fails
return [
// ... (votre base de données locale de films)
];
}
}
// Initialize the page
document.addEventListener('DOMContentLoaded', async function() {
// Add container div for the video player
const videoContainer = document.querySelector('.player-container');
videoContainer.innerHTML = `<div id="full-movie-container"></div>`;
// Load movies from API
await fetchMovies();
// Search functionality
const searchInput = document.getElementById('search-input');
const searchResults = document.getElementById('search-results');
const mobileMenuBtn = document.getElementById('mobile-menu-btn');
const mobileMenu = document.getElementById('mobile-menu');
searchInput.addEventListener('input', function() {
const query = this.value;
if (query.length > 2) {
const results = searchMovies(query);
if (results.length > 0) {
searchResults.innerHTML = results.map(movie => `
<div class="p-3 hover:bg-gray-700 cursor-pointer flex items-center" onclick="loadMovie(${movie.id})">
<img src="${movie.poster}" alt="${movie.title}" class="w-10 h-14 object-cover rounded mr-3">
<div>
<div class="font-medium">${movie.title}</div>
<div class="text-xs text-gray-400">${movie.year} • ${movie.genres.map(g => g.name).join(', ')}</div>
</div>
</div>
`).join('');
searchResults.classList.remove('hidden');
} else {
searchResults.innerHTML = '<div class="p-3 text-gray-400">Aucun résultat trouvé</div>';
searchResults.classList.remove('hidden');
}
} else {
searchResults.classList.add('hidden');
}
});
// Close search results when clicking outside
document.addEventListener('click', function(e) {
if (!searchInput.contains(e.target) && !searchResults.contains(e.target)) {
searchResults.classList.add('hidden');
}
});
// Mobile menu toggle
mobileMenuBtn.addEventListener('click', function() {
mobileMenu.classList.toggle('hidden');
});
// Category filter
document.querySelectorAll('.category-btn').forEach(btn => {
btn.addEventListener('click', function() {
// Set active button
document.querySelectorAll('.category-btn').forEach(b => b.classList.remove('active', 'bg-blue-600'));
this.classList.add('active', 'bg-blue-600');
// Filter movies
const category = this.dataset.category;
const filteredMovies = filterMoviesByCategory(category);
// Update movie sections
document.getElementById('trending-movies').innerHTML =
filteredMovies.filter(m => m.trending).map(createMovieCard).join('');
document.getElementById('top-rated-movies').innerHTML =
filteredMovies.filter(m => m.topRated).map(createMovieCard).join('');
document.getElementById('new-releases').innerHTML =
filteredMovies.filter(m => m.year >= new Date().getFullYear() - 2).map(createMovieCard).join('');
});
});
// Load initial movies
document.getElementById('trending-movies').innerHTML =
movieDatabase.filter(m => m.trending).map(createMovieCard).join('');
document.getElementById('top-rated-movies').innerHTML =
movieDatabase.filter(m => m.topRated).map(createMovieCard).join('');
document.getElementById('new-releases').innerHTML =
movieDatabase.filter(m => m.year >= new Date().getFullYear() - 2).map(createMovieCard).join('');
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=docto41/cin-full" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |