Code Monkey home page Code Monkey logo

embed-sdk-js's People

Contributors

vintikzzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

embed-sdk-js's Issues

Cheap porno ads playing

I'm trying to create a webtorrent based video player and I've excluded all adult content from playing on the site, apart from your ads. You've built a really good player but what's the point when you are ending up showing ads for pornos?

subtitle is not visible on mobile device when player is on fullscreen mode

At first, it's fine with mobile device, everything is ok and subtitles are visible but when i turn on fullscreen mode player is not showing subtitles, then when i turn off fullscreen mode subtitles are visible but in so small size, i can see it barely. And also, timeline is not hidden, it's always visible and covering subtitles in mobile device. It's so annoying, Please fix this issue..
my email address: [email protected]

iFrameSizer memory leak

I use Webtor embed with React in a single-page application. For this reason, the element that contains Webtor iframe gets deleted and re-created often. I noticed that after each delete, iFrameResizer floods the console with messages if window gets resized. After investigation, I found that it keeps listeners for all Webtor iframes that ever existed. Please see this demo of the issue.

I looked around at iFrameResizer code and found a possible solution. It exposes a close method which cleans up all of the listeners and removes the referenced iframe element. I think there are couple of possible ways to use this:

  • During webtor.push add a mutation observer and do the iFrameResizer clean-up when iframe is removed from DOM
  • Expose something like webtor.close which users of embed-sdk-js would have to call manually when clean-up is needed

Or is there already a way to clean-up and I missed it?

how to use torrentUrl?

can someone tell me how to play a torrent file using torrentUrl. When i run my code i got this "Preparing Video Stream... Please Wait..."
i include header('Access-Control-Allow-Origin: *'); with php
Here is my code
`

<div id="player" class="webtor" />
<script>
    window.webtor = window.webtor || [];
    window.webtor.push({
        id: 'player',
        torrentUrl: 'test.torrent',
        on: function(e) {
            if (e.name == window.webtor.TORRENT_FETCHED) {
                console.log('Torrent fetched!', e.data);
            }
            if (e.name == window.webtor.TORRENT_ERROR) {
                console.log('Torrent error!');
            }
        },
        poster: 'https://via.placeholder.com/150/0000FF/808080?Text=Sintel',
        subtitles: [
            {
                srclang: 'en',
                label: 'test',
                src: 'https://raw.githubusercontent.com/andreyvit/subtitle-tools/master/sample.srt',
            }
        ],
        lang: 'en',
        i18n: {
            en: {
                common: {
                    "prepare to play": "Preparing Video Stream... Please Wait...",
                },
                stat: {
                    "seeding": "Seeding",
                    "waiting": "Client initialization",
                    "waiting for peers": "Waiting for peers",
                    "from": "from",
                },
            },
        },
    });
</script>
<script src="https://cdn.jsdelivr.net/npm/@webtor/player-sdk-js/dist/index.min.js" charset="utf-8"></script>

`

Webtor Video is not played

The video player disappear after click play for a while.
here is the magnet link to check:

magnet:?xt=urn:btih:2bdeb90d24221269ffc64058c814212bda354ca0

error shows at inspect:
Uncaught (in promise) DOMException: Failed to load because no supported source was found.

Problem with subtitles from OpenSubtitles

I have a problem with downloading subtitles from OpenSubtitles, when I enter the subtitle selection and select OpenSubtitles I get the message "No subtitles".

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
 <div id="player" class="webtor" />
    <script>
        window.webtor = window.webtor || [];
        window.webtor.push({
            id: 'player',
            magnet: 'magnet:?xt=urn:btih:d7a46713eaee18c746b3254b7d1492a50fd9d6ce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fp4p.arenabg.com%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.moeking.me%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.cyberia.is%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker4.itzmx.com%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fexplodie.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fpublic.popcorn-tracker.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.vanitycore.co%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker1.itzmx.com%3A8080%2Fannounce&tr=udp%3A%2F%2Fipv4.tracker.harry.lu%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fdenis.stalker.upeer.me%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.port443.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Fopen.demonii.si%3A1337%2Fannounce&tr=udp%3A%2F%2Fbt.xxx-tracker.com%3A2710%2Fannounce&tr=udp%3A%2F%2Fthetracker.org%3A80%2Fannounce&tr=udp%3A%2F%2Fretracker.lanta-net.ru%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.uw0.xyz%3A6969%2Fannounce&dn=%5BSolidTorrents.net%5D+The+Matrix+(1999)+%5B1080p%5D',
            title: 'The Matrix (1999)',
            imdbId: 'tt0133093',
            on: function(e) {
                if (e.name == window.webtor.TORRENT_FETCHED) {
                    console.log('Torrent fetched!')
                }
                if (e.name == window.webtor.TORRENT_ERROR) {
                    console.log('Torrent error!')
                }
            },
        });
    </script>
    <script src="https://cdn.jsdelivr.net/npm/@webtor/player-sdk-js/dist/index.min.js" charset="utf-8"></script>
</body>
</html>

Unable to load torrent-file!

Whenever I try to paste magnet link or open torrent file, it says "Unable to load torrent-file! Try to load torrent-file with "Open torrent online button" ". It happens when I use 1DM or any other download manager with browser on Android but not when I use Firefox. Any way to fix it? I don't want to use Firefox because it doesn't support resume downloads. Last time I used this website was like 2 weeks ago and was working fine with 1DM.

Edit Player UI

If I were to edit the player's UI, how would I go about doing so? I can't find any css files in the source code and the player looks a little different from the default mediaplayer.js player.
I want to personalise it / make it look and feel a little better, either by using an API or forking and editing the code myself, thanks.

How to make the player work with chromecast?

Chromecast option when playing videos is not showing.

export let loadPlayer = async (torrent_magnet) => {
  window.webtor = window.webtor || [];
  window.webtor.push({
    id: 'player',
    magnet: torrent_magnet,
    width: '100%',
    on: function (e) {
      if (e.name == window.webtor.TORRENT_FETCHED) {
        console.log('Torrent fetched!', e.data);
      }
      if (e.name == window.webtor.TORRENT_ERROR) {
        console.log('Torrent error!');
      }
    },
    features: {
      p2pProgress: true,
      title:       true,
      settings:    true,
      fullscreen:  true,
      subtitles:   true,
      continue:    true,
      playpause:   true,
      currentTime: true,
      timeline:    true,
      duration:    true,
      volume:      true,
      chromecast:  true,
      browse:      true,
      download:    true,
    },
    i18n: {
      en: {
        common: {
          "prepare to play": "Preparing Video Stream... Please Wait...",
        },
        stat: {
          "seeding": "Seeding",
          "waiting": "Client initialization",
          "waiting for peers": "Waiting for peers",
          "from": "from",
        },
      },
    },
  });
};

Any implementation required to make that functionality work?

React Native support

Would it be possible to make webtor player-sdk-js compatible with React Native?

I'll appreciate your prompt response!

Corrupted archive and incomplete files

I'm trying to download .mkv movie files with webtor but every single one of them ends up being corrupted.

The files are about 10-15 GB each and while the whole .zip file shows the correct size, the actual video file inside the archive is only about 4 GB. WinRAR refuses to unpack it and when I manage to unpack it with 7zip the video file is incomplete and only about a third of the whole movie.

I already tried a download manager instead of using the browser and it's still the same issue.

Hide download file

Hello, I want to hide the message to download file, I just want to allow my users to see the torrent.

How can I do this?

Video not start when is converted on Android.

When file is not mp4 and start converted, video not start to play in Android. Just poster seen on screen. Tested on Android 8.1 and 10, with chrome and opera. If file is mp4 video start and play.

The ad duration is displayed as video/movie duration after skipping ad

Sometimes when i skip an ad, the player shows the total length of the video to be played as the length of the ad I just skipped.

For eg- if an ad is 15 seconds long and the video is 1 hour long, the player keeps showing 15 seconds as the total duration of the video. On crossing the 15 sec mark, the video keeps playing.

It does not cause an issue functionally, but sometimes a viewer may think they have opened the wrong video because of the short duration showed.

Player not working on iOs safari

Player does not work on iphone and ipad safari

window.webtor = window.webtor || [];
window.webtor.push({
id: 'player',
magnet: magnet:?xt=urn:btih:${param.th}&dn=${param.mn},
on: function(e) {
if (e.name == window.webtor.TORRENT_FETCHED) {
console.log('Torrent fetched!', e.data);
}
if (e.name == window.webtor.TORRENT_ERROR) {
console.log('Torrent error!');
}
},
poster: imagePath,
subtitles: [

        ],
        lang: 'en',
        i18n: {
            en: {
                common: {
                    "prepare to play": "Preparing Video Stream... Please Wait...",
                },
                stat: {
                    "seeding": "Seeding",
                    "waiting": "Client initialization",
                    "waiting for peers": "Waiting for peers",
                    "from": "from",
                },
            },
        },
    });

Webtor Video. position changed after resize

After resize and restore the Iframe the video player doesn't restore the size as same Iframe.
How to test ?
1: Resize the window to 25% your screen.
2: Embed the Webtor as Video.(make sure you set Iframe with height and width = 100%)
3: Resize the window to 100% your screen.
4: Restore the window to 25% your screen.
-> Result: The player doesn't restore the size as same as window.
-> Expect: The player should restore the size as same as window.

How to edit headings

Hey @vintikzzz , I want to change the headings/text that is shown on loading torrent like 'magnetising torrent' or 'seeding x MB of y MB', etc. How can I change this?

Playing a video without a server

Hello,

Is it possible to configure without an external server? Here, from what I see playing video when external server start downloading torrent. Is it possible to download directly? So when the user starts playing, he downloads via torrent in the background and seed.

Thanks for answer.

Changing audio tracks doesn't work

I tried playing a video torrent that has dual audio tracks, it worked with the default audio, but I changed the audio track and when i click apply it just minimizes the player and shows only the title.

Watch together feature request

Hey @vintikzzz ! I was checking out powder web and i saw there was a feature to watch together with friends. Is this something we can do in webtor or can you please add this feature. This will be an amazing feature for webtor

Progressbar just showing loaded pieces

I am read over last Webtor updates and found something about this, but early version is have full progressbar with abilty to scroll to any place of streaming video.
Now this feature is dead.
Maybe you can review something?

subs auto select/start

hello, how can i make subs auto start here is my code but not working, its working only if i choose manual the subs.

`<script>
window.webtor = window.webtor || [];
window.webtor.push({
id: 'player',
magnet: 'magnet:?xt=urn:btih:',
width: '100%',
on: function(e) {
if (e.name == window.webtor.TORRENT_FETCHED) {
console.log('Torrent fetched!', e.data);
}
if (e.name == window.webtor.TORRENT_ERROR) {
console.log('Има проблем, моля те докладвай го този филм!');
}
},
poster: 'https://www.filmite-bg.com/poster.jpg',

        subtitles: [
		{
                srclang: 'bg',
                label: 'Български',
                src: 'url-to-my-subs',
            }
			
        ],
		
		
		
		  features: [
            {
                    p2pProgress: true,
title:       false,
settings:    true,
fullscreen:  true,
subtitles:   true,
continue:    true,
playpause:   true,
currentTime: true,
timeline:    true,
duration:    true,
volume:      true,
chromecast:  true,
browse:      false,
download:    true,
            }
        ],

        lang: 'en',
        i18n: {
            en: {
                common: {
                    "prepare to play": "Зареждаме видеото... Моля за търпение...",
                },
                stat: {
                    "seeding": "Сиидваме",
                    "waiting": "Свързване",
                    "waiting for peers": "Чакаме за пиъри",
                    "from": "От",
                },
            },
        },
    });
	
</script>`

Dont show player

Hi, i like webtor, i want put your player in my site, but i have a problem, i convert .torrent file to magnet, but dont show player, only website.

https://prnt.sc/qvprth

Thanks.

Cant get player currentTime and other controls

Im trying to use some commands on the player like

  • currentTime
  • play
  • pause

the commands will return null unless I use inspect elements

the upper command before using inspect element, and the bottom one after using inspect element

chrome_lff76xOnG1

Commands I'm trying (works after inspect elements only)
chrome_nY3uo9FG58

Does not work on iPhone

I like this streaming player and works great but only 1 problem its not working on iPhone when I open embedded player over iPhone it shows webtor.io website's index page instead of playing the file.
It seems you did not add the ios support to the player please add support for ios devices and then your player will be the best torrent streaming player in the world.

Thanks
hope this service stays online forever
long live webtor.io

Video doesn't play even if a substantial amount is downloaded

Sometimes the video is downloaded enough to start playing but it doesn't start and I have to refresh the page for it to start.

I have attached a screenshot where you can see that the player has downloaded enough to start playing but it still shows the thumbnailScreenshot_20200726-020436.jpg

Not working with browsers with single window(tab)

Tesla browsers doesn't hava multi windows (tabs). I think there was a change in code, where before ads would open in popups. Now when I press play, the ad opens in new window. It's not a problem if your browser supports tabs. But as mentioned above, Tesla browser doesn't support multi tabs, hence the ad opens in the same window. When I press back it goes to previous window. When I press Play, it opens ad in the same window. Would it be possible to fix? As it was working fine few weeks ago.

3.mp4

Doesn't see any related changes, but embed player loose playlist

Hello @vintikzzz !

I am using next code to integrate with website, but now player load first file, and don't give a ability to select other.
I am look over last changes, but don't see options/settings for this in player js sdk.

<script>
        window.webtor = window.webtor || [];
        window.webtor.push({
            id: 'player',
            magnet: 'magnet:?xt=u',
            on: function(e) {
                if (e.name == window.webtor.TORRENT_FETCHED) {
                    console.log('Torrent fetched!')
                }
                if (e.name == window.webtor.TORRENT_ERROR) {
                    console.log('Torrent error!')
                }
            },
        });
    </script>

Not working!

It works only when we statically give the link of torrent file to the src. When src attribute is updated with javascript video doesn't load.

Not able to switch torrent that is being played

I am trying to implement a feature where a user can select a torrent from a list and it starts playing in your Webtor embed. When I select a torrent the first time, it starts playing just fine. However, when I select a second torrent, while the first selection is playing, your player does not react.

I did some debugging and found that on second selection everything works as expected until this check in your script:
else if (d.name == self.INJECT && !injected)
From what I understand, the only way to set injected back to false is to reload the whole script by reloading the page, which is not a desired workaround for me.

I found that this is caused by an intentional change that you made in this commit: fix multiple players per window. It makes sense because when I manually set injected to false during debug, then another Webtor embed is created underneath the first one which causes 2 torrents to play at the same time. However, wouldn't it solve the problem if I remove the container element, then recreate it before "pushing" the second torrent? Are there bad side effects to this approach?

I also looked around for other apps that use your SDK and have a similar use case to mine. I found PopcornTime Show. It seems that dynamic switching also does not work in this app and the only way to play another torrent is to reload the page. So maybe @ChrisMichaelPerezSantiago would also be interested in this.

Thank you for the great service that you are providing. Webtor is definitely one of a kind.

Error with fetching torrent

Hello Webtor.
Just trying to include player on my page, but has no luck with it.
Getting "torrent error" on any magnet.
Live example doesn't work too.
Any solution/suggestion?

'Download at webtor' logo above controls

The z-index of the 'download at webtor' logo on the bottom left is higher than the z-index of the controls. This is particularly annoying on mobile devices because it blocks the user from selecting a subtitle. Is it possible to fix this and/or hide the 'download at webtor' logo?

Player is not working

The player is working on the provided example. But when you change the magnet url it is not working, no matter which button you click it will open ad popup.
Tested on Google Chrome Version 89.0.4389.82 (Official Build) (64-bit)
Code that i've been testing with:

<!doctype html>
<html>

<head>
    <title>Webtor Player SDK Example</title>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <meta content="ie=edge" http-equiv="x-ua-compatible">
    <style>
        html, body {
            margin: 0;
            padding: 0;
            overflow: hidden;
            width: 100%;
            height: 100%;
        }
        #player {
            height: 80%;
        }
        #controls {
            padding: 1rem;
        }
        #controls i {
            padding-top: 0.3rem;
            display: block;
        }
        .control {
            padding-right: 1rem;
        }
        #files {
            padding: 0.5rem;
        }
        #files a {
            padding: 0.5rem;
        }
    </style>
</head>

<body>
<div id="controls">
        <span class="control">
            External controls*:
            <button id="play">Play</button>
            <button id="pause">Pause</button>
            <button id="moveto1min">Move to 1 min</button>
            <button id="movetostart">Move to start</button>
        </span>
    <span class="control">
            Player status: <span id="player-status">NONE</span>
        </span>
    <span class="control">
            Current time: <span id="current-time">0</span> sec
        </span>
    <span class="duration">
            Duration: <span id="duration">0</span> sec
        </span>
    <br />
    <i>* - works only after first click on play button in the player</i>
</div>
<div id="player"></div>
<div id="files"></div>
<script>
    window.webtor = window.webtor || [];
    window.webtor.push({
        id: 'player',
        baseUrl: 'https://webtor.io',
        // baseUrl: 'http://192.168.0.100:4000',
        magnet: 'magnet:?xt=urn:btih:c9e15763f722f23e98a29decdfae341b98d53056&dn=Cosmos+Laundromat&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fcosmos-laundromat.torrent',
        // magnet: 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F',
        width: '100%',
        height: '100%',
        features: {
            continue:    false,
            // title:       false,
            // p2pProgress: false,
            // subtitles:   false,
            // settings:    false,
            // fullscreen:  false,
            // playpause:   false,
            // currentTime: false,
            // timeline:    false,
            // duration:    false,
            // volume:      false,
            // chromecast:  false,
        },
        on: function(e) {
            if (e.name == window.webtor.TORRENT_FETCHED) {
                console.log('Torrent fetched!', e.data.files);
                var p = e.player;
                var files = document.getElementById('files');
                for (const f of e.data.files) {
                    if (!f.name.endsWith('.mp4')) continue;
                    var a = document.createElement('a');
                    a.setAttribute('href', f.path);
                    a.innerText = f.name;
                    files.appendChild(a);
                    a.addEventListener('click', function(e) {
                        e.preventDefault();
                        p.open(e.target.getAttribute('href'));
                        return false;
                    });
                }
            }
            if (e.name == window.webtor.TORRENT_ERROR) {
                console.log('Torrent error!')
            }
            if (e.name == window.webtor.INITED) {
                var p = e.player;
                document.getElementById('play').addEventListener('click', function(ev) {
                    p.play();
                });
                document.getElementById('pause').addEventListener('click', function(ev) {
                    p.pause();
                });
                document.getElementById('moveto1min').addEventListener('click', function(ev) {
                    p.setPosition(60);
                });
                document.getElementById('movetostart').addEventListener('click', function(ev) {
                    p.setPosition(0);
                });
            }
            if (e.name == window.webtor.PLAYER_STATUS) {
                document.getElementById('player-status').innerHTML = e.data;
            }
            if (e.name == window.webtor.OPEN) {
                console.log(e.data);
            }
            if (e.name == window.webtor.CURRENT_TIME) {
                document.getElementById('current-time').innerHTML = parseInt(e.data);
            }
            if (e.name == window.webtor.DURATION) {
                document.getElementById('duration').innerHTML = parseInt(e.data);
            }
            if (e.name == window.webtor.OPEN_SUBTITLES) {
                console.log(e.data);
            }
        },
    });
</script>
<script src="https://cdn.jsdelivr.net/npm/@webtor/[email protected]/dist/index.min.js" charset="utf-8"></script>
</body>

Selected file in torrent in selected directory not working!

I use file Player configuration Attribute and working fine before, but now not working it's show only first video file!

<script> window.webtor = window.webtor || []; window.webtor.push({ id: 'player', width: '100%', magnet: 'magnet:?xt=urn:btih:a5798e1d8641b2d11f9b124f47cda24fc94b62d5', on: function(e) { if (e.name == window.webtor.TORRENT_FETCHED) { console.log('Torrent fetched!') } if (e.name == window.webtor.TORRENT_ERROR) { console.log('Torrent error!') } }, poster: 'https://zamunda.net/pic/img4/bitbucket/412933/1613722645_2610928.jpg',
        file: 'Tell.Me.Your.Secrets.S01E04.720p.AMZN.WEB-DL.DDP5.1.H.264-NTG.mkv',
        subtitles: [
            {
                srclang: 'Bulgarian',
                label: 'Български',
                src: '',
                autoselect: true,
            }
        ],
		
        features: {
p2pProgress: true,
title:       true,
settings:    true,
fullscreen:  true,
subtitles:   true,
continue:    true,
playpause:   true,
currentTime: true,
timeline:    true,
duration:    true,
volume:      true,
chromecast:  true,
browse:      true,
download:    true,

}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/@webtor/player-sdk-js/dist/index.min.js" charset="utf-8" async></script>

And this is results

Unable to import as module

I noticed that the only way to use this package is by directly downloading it from CDN in a script tag, like so:
<script src="https://cdn.jsdelivr.net/npm/@webtor/embed-sdk-js/dist/index.min.js" charset="utf-8" async></script>

I can install it via package manager and import with either require("@webtor/embed-sdk-js/dist/index.min.js") or import "@webtor/embed-sdk-js/dist/index.min.js. The script loads into the browser correctly. However, when I use webtor.push, the Webtor embed doesn't show up.

I did some debugging and found that the problem happens here:

else if (d.name == self.INJECT) {
            eval(d.data);
}

d.data contains a code snippet that looks for the exact CDN link in script tags, like so:
scripts[i].src.includes('https://cdn.jsdelivr.net/npm/@webtor/')
If the CDN link is not found, then the check fails and Webtor embed never gets loaded. When I remove the CDN link check from d.data, Webtor embed works as expected even if imported as module.

Here are some pros for being able to import as module:

  • straight forward versioning via package manager
  • easier to use with UI frameworks (ex. Removes the need to manually create script tags in the DOM inside a React component)
  • more control with bundlers (ex. Dynamic imports with code splitting)
  • reference to corresponding type definitions

Advertising on Webtor

Is there a possibility to have an ad-free player?
Or is it the indirect way to stimulate the payment of money to your project?
I think the one you provide is an excellent service, but I try to use it in Samsung's Tizen browser, which doesn't support extensions like Adblock, and I can't watch a movie without the same Webtor.io player showing me pornographic or product advertisements. random, for the same reason I ask again, is there a way to have a clean version of the code?

Download links to individual files within a torrent

Is it possible to get the download link to a particular file inside of a torrent by using the path in the download embed generator script. It's possible to play a particular file through the player embed generator by defining the path but the same doesn't seem to work in case of the download embed generator.

Download links to each individual file can be obtained from the webtor.io website but it would be cool if the same could be done through the SDK

Example: I want to download only the poster.jpg file from the Sintel torrent. But when I use the code below, it gives me the download link for the entire Sintel.zip.

    <div id="player" class="webtor" />
    <script>
        window.webtor = window.webtor || [];
        window.webtor.push({
            id: 'player',
            mode: 'download',
            path: 'Sintel/poster.jpg',
            magnet: 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F',
            on: function(e) {
                if (e.name == window.webtor.TORRENT_FETCHED) {
                    console.log('Torrent fetched!', e.data);
                }
                if (e.name == window.webtor.TORRENT_ERROR) {
                    console.log('Torrent error!');
                }
            },
            lang: 'en',
            i18n: {
                en: {
                    common: {
                        "prepare to play": "Preparing Video Stream... Please Wait...",
                    },
                    stat: {
                        "seeding": "Seeding",
                        "waiting": "Client initialization",
                        "waiting for peers": "Waiting for peers",
                        "from": "from",
                    },
                },
            },
        });
    </script>
    <script src="https://cdn.jsdelivr.net/npm/@webtor/embed-sdk-js/dist/index.min.js" charset="utf-8" async></script>

Player not showing on TV

Hello, a few months ago the player stopped showing on TV web browser. It was working perfectly but one day it just stop, any idea what may cause this problem i tryed on different TV's and problem is the same. Tested on Tizen (Samsung) and WEbOS (LG). Is there any lite version of the player that i can test it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.