A clean, ad-free video player with aggressive ad-blocking features deployed on Vercel.
- Ad Blocking: Aggressive popup and ad blocking
- Clean Interface: Fullscreen video player with no distractions
- Caching: 30-minute cache for faster loading
- Mobile Optimized: Works perfectly on all devices
- HTTPS Enforcement: Automatically upgrades all connections to HTTPS
-
Install Vercel CLI:
npm install -g vercel
-
Login to Vercel:
vercel login
-
Deploy:
vercel
-
For production deployment:
vercel --prod
- Go to vercel.com
- Click "New Project"
- Import this repository
- Vercel will auto-detect settings
- Click "Deploy"
https://your-app.vercel.app/
Shows a demo player with the test video.
https://your-app.vercel.app/embed/VIDEO_URL
Example:
https://your-app.vercel.app/embed/https%3A%2F%2Fhglink.to%2Fe%2F0tmqi4jmtowr
<iframe
src="https://your-app.vercel.app/embed/https%3A%2F%2Fhglink.to%2Fe%2F0tmqi4jmtowr"
width="100%"
height="500"
frameborder="0"
allowfullscreen
></iframe>-
Install dependencies:
npm install
-
Run development server:
npm run dev
-
Open browser:
http://localhost:3000
Home page with demo player
Main embed player endpoint
- Parameters:
id- Video URL (can be encoded or plain) - Returns: HTML player page
Legacy endpoint - redirects to embed
- Returns: JSON with embed URL
Edit api/index.js, line with setCache:
setCache(cacheKey, iframeSrc, 1800); // 30 minutes in secondsAd blocking script is in the getAdBlockScript() function. Customize the blockList array to add more patterns:
const blockList = [
'doubleclick',
'googlesyndication',
'advertising',
// Add more patterns here
];Edit the generateCleanPlayer() function to customize the player appearance.
Edit the generateErrorPage() function to customize error messages.
.
├── api/
│ └── index.js # Main application file
├── package.json # Dependencies
├── vercel.json # Vercel configuration
└── README.md # This file
- HTTPS enforcement
- Content Security Policy headers
- Popup blocking
- Ad script blocking
- Safe iframe handling
The player automatically adjusts to:
- Desktop browsers
- Tablets
- Mobile devices
- Different screen orientations
- Check if the video URL is valid
- Ensure HTTPS is being used
- Clear cache and try again
- The ad blocker works on popup/overlay ads
- Some embedded ads in the video stream cannot be blocked
- Try refreshing the page
- Make sure
vercel.jsonis in the root directory - Check that
api/index.jsexists - Verify Node.js version compatibility
MIT License - feel free to use this in your projects!
Built with:
- Use URL encoding for video URLs with special characters
- Cache is stored in memory and resets on deployment
- For production, consider using Redis for persistent cache
Direct embed:
/embed/https://hglink.to/e/0tmqi4jmtowr
URL encoded:
/embed/https%3A%2F%2Fhglink.to%2Fe%2F0tmqi4jmtowr
Both formats work!