Creating a compatible M3U playlist for xPola Player involves utilizing a text editor such as Bloc Note or Notepad++. Follow these steps to craft a playlist with the specified features:
1- Open Bloc Note or Notepad++ and save the file with a name of your choice, such as name.m3u.
2- Begin the file with the following header to indicate that it is an M3U playlist:
#EXTM3U
3- Add links in the following format for each entry:To add a link with an image and name, use the code below, replacing "Video Name 1," "https://example.com/images/logo.jpeg," and "https://example.com/file/video.m3u8" with the appropriate details:
#EXTINF:-1 group-title="Group Name" tvg-logo="https://example.com/images/logo.jpeg", Video Name 1
https://example.com/file/video.m3u8
To add a link requiring a user-agent, insert the code below before the video link, replacing "your agent here" with your specific user-agent:
EXTVLCOPT:http-user-agent=your agent here
Example:
#EXTINF:-1 group-title="Group Name" tvg-logo="https://example.com/images/logo.jpeg", Video Name 1
EXTVLCOPT:http-user-agent=your agent here
https://example.com/file/video.m3u8
To add a link requiring a referer, use the code below before the video link, replacing "https://domaine.com//" with your specific referer link:
#EXTVLCOPT:http-referrer=https://domaine.com//
Example:
#EXTINF:-1 group-title="Group Name" tvg-logo="https://example.com/images/logo.jpeg", Video Name 1
#EXTVLCOPT:http-referrer=https://domaine.com//
https://example.com/file/video.m3u8
To add a web player link, use the code below before the video link:
#EXTVLCOPT:http-player-type=webplayer
Example:
#EXTINF:-1 group-title="Group Name" tvg-logo="https://example.com/images/logo.jpeg", Video Name 1
#EXTVLCOPT:http-player-type=webplayer
https://example.com/file/video.html
To add a link that opens in an external browser, use the code below:
#EXTVLCOPT:http-player-type=external
Example:
#EXTINF:-1 group-title="Group Name" tvg-logo="https://example.com/images/logo.jpeg", Video Name 1
#EXTVLCOPT:http-player-type=external
https://example.com/file/video.html
To add a link requiring both user-agent and referer, use the code below, replacing "https://domaine.com//" with your referer link and "your agent here" with your user-agent:
#EXTINF:-1 group-title="Group Name" tvg-logo="https://example.com/images/logo.jpeg", Video Name 1
#EXTVLCOPT:http-referrer=https://domaine.com//
#EXTVLCOPT:http-user-agent=your agent here
https://example.com/file/video.m3u8
Customize the styling as needed, and save the file as name.m3u
.
To open a video link from a web page in the xPola Player application, use the following code snippet within a PHP-formatted web page:
name.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #000;
}
.play-button {
background-color: #f7f7f7;
color: #fff;
border: none;
padding: 10px;
font-size: 24px;
cursor: pointer;
border-radius: 50%; /* Make the button circular */
display: flex;
align-items: center;
justify-content: center;
}
.play-button:hover {
background-color: #999;
}
</style>
<title>Play Button</title>
</head>
<body>
<?php
$videoUrl = "https://example.com/file/playlist.m3u8";
?>
<button onClick="location.href='intent://<?php echo base64_encode($videoUrl) ; ?>#Intent;scheme=xmtv;package=com.xpola.player;end'" class="play-button">
<svg fill="#000000" height="80px" width="80px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 60 60" xml:space="preserve">
<g>
<path d="M45.563,29.174l-22-15c-0.307-0.208-0.703-0.231-1.031-0.058C22.205,14.289,22,14.629,22,15v30
c0,0.371,0.205,0.711,0.533,0.884C22.679,45.962,22.84,46,23,46c0.197,0,0.394-0.059,0.563-0.174l22-15
C45.836,30.64,46,30.331,46,30S45.836,29.36,45.563,29.174z M24,43.107V16.893L43.225,30L24,43.107z"/>
<path d="M30,0C13.458,0,0,13.458,0,30s13.458,30,30,30s30-13.458,30-30S46.542,0,30,0z M30,58C14.561,58,2,45.439,2,30
S14.561,2,30,2s28,12.561,28,28S45.439,58,30,58z"/>
</g>
</svg>
</button>
</body>
</html>
To add a link, you need to specify the 'referer'.
<?php
$videoUrl = "https://example.com/file/playlist.m3u8|referer=https://domaine.com/";
?>
To add a link, you need to specify the 'user-agent'.
<?php
$videoUrl = "https://example.com/file/playlist.m3u8|user-agent=YourAgentHere";
?>
To add a link, you need to specify the 'user-agent' and 'referer'.
<?php
$videoUrl = "https://example.com/file/playlist.m3u8|user-agent=YourAgentHere|referer=https://domaine.com/";
?>
name.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #000;
}
.play-button {
background-color: #f7f7f7;
color: #fff;
border: none;
padding: 10px;
font-size: 24px;
cursor: pointer;
border-radius: 50%; /* Make the button circular */
display: flex;
align-items: center;
justify-content: center;
}
.play-button:hover {
background-color: #999;
}
</style>
<title>Play Button</title>
</head>
<body>
<button id="play-button" class="play-button">
<svg fill="#000000" height="80px" width="80px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 60 60" xml:space="preserve">
<g>
<path d="M45.563,29.174l-22-15c-0.307-0.208-0.703-0.231-1.031-0.058C22.205,14.289,22,14.629,22,15v30
c0,0.371,0.205,0.711,0.533,0.884C22.679,45.962,22.84,46,23,46c0.197,0,0.394-0.059,0.563-0.174l22-15
C45.836,30.64,46,30.331,46,30S45.836,29.36,45.563,29.174z M24,43.107V16.893L43.225,30L24,43.107z"/>
<path d="M30,0C13.458,0,0,13.458,0,30s13.458,30,30,30s30-13.458,30-30S46.542,0,30,0z M30,58C14.561,58,2,45.439,2,30
S14.561,2,30,2s28,12.561,28,28S45.439,58,30,58z"/>
</g>
</svg>
</button>
<script>
document.getElementById('play-button').addEventListener('click', function() {
var videoUrl = "https://example.com/file/playlist.m3u8|referer=https://domaine.com/";
var encodedUrl = btoa(videoUrl);
location.href = 'intent://'+ encodedUrl +'#Intent;scheme=xmtv;package=com.xpola.player;end';
});
</script>
</body>
</html>