# Проблема при встраивании плеера на страницу - failed to open transport file

**URL:** <https://forum.acestream.media/t/problema-pri-vstraivanii-pleera-na-straniczu-failed-to-open-transport-file/3307>\
**Category:** Issues and Solutions\
**Created:** [10.Май.2016 09:21:38 UTC](https://forum.acestream.media/t/problema-pri-vstraivanii-pleera-na-straniczu-failed-to-open-transport-file/3307 "2016-05-10T09:21:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deus](https://forum.acestream.media/user_avatar/forum.acestream.media/deus/32/1017_2.png) [@Deus](https://forum.acestream.media/u/Deus)\
**Post date:** [10.Май.2016 09:21:38 UTC](https://forum.acestream.media/t/problema-pri-vstraivanii-pleera-na-straniczu-failed-to-open-transport-file/3307/1 "2016-05-10T09:21:38Z")

</div>

При встраивании плеера на страницу и вставке ссылки на свой торрент файл возникает следующая ошибка:

failed to open transport file

Пытаюсь установить на страницу следующий плеер [http://acestream.net/demos/embedding/index.html](http://acestream.net/demos/embedding/index.html)

Со стандартной ссылкой this.loadTorrent(“[http://content.torrent-tv.ru/cdn/223\_all.acelive](http://content.torrent-tv.ru/cdn/223_all.acelive)”, {autoplay: true});  
или  
this.loadTorrent(“[http://1ttv.org/torrents/21/mFJwfnnOl3fT6P4wFQdC64TmSGlaIO.torrent](http://1ttv.org/torrents/21/mFJwfnnOl3fT6P4wFQdC64TmSGlaIO.torrent)”,{autoplay: true});

Все работает как только пытаюсь подставить свой торрент файл выдает ошибку failed to open transport file

Что нужно дописать на странице к плееру?

Подскажите в чем проблема

На данный момент код выглядит следующим образом

```
    <script type="text/javascript" src="//static.acestream.net/jsapi-beta/js/lib/ts/core.js"></script>
    <script type="text/javascript" src="//static.acestream.net/jsapi-beta/js/lib/jquery/jquery-1.7.min.js"></script>
    <script type="text/javascript" src="//static.acestream.net/jsapi-beta/js/lib/ts/player.js?2"></script>
    <script type="text/javascript" src="//static.acestream.net/jsapi-beta/js/lib/ts/controls.js"></script>
    
    <script>
    window.$ = window.jQuery = window.TorrentStream.jQuery;
    var player_context = null;
    
    console.log("1>> magicplayer=" + typeof magicplayer);
    console.log("1>> TorrentStream=" + typeof TorrentStream);
    setTimeout(function() {
            console.log("2>> magicplayer=" + typeof magicplayer);
            console.log("2>> TorrentStream=" + typeof TorrentStream);
    }, 5000);
    
    function setupEvents()
    {
        $(".switch-channel").click(function() {
                var contentId = $(this).data("content-id"),
                    transportFileURL = $(this).data("transport-file-url");
                    
                player_context.playlistClear();
                if(transportFileURL) {
                    player_context.loadTorrent(transportFileURL, {autoplay: true});
                }
                else if(contentId) {
                    player_context.loadPlayer(contentId, {autoplay: true});
                }
                else {
                    console.log("missing source id");
                }
        });
    }
    
    function init() {
        var controls = new TorrentStream.Controls("tvplayer", {
            style: "internal",
            debug: false
        });
        try {
            // Assign player_context in onLoad handler because it can differ
            // from return value of TorrentStream.Player. For example,
            // TorrentStream.FlashPlayer can be returned.
            new TorrentStream.Player(controls.getPluginContainer(), {
                debug: false,
                useInternalControls: true,
                bgColor: "#000000",
                fontColor: "#ffffff",
                onLoad: function () {
                    this.registerEventHandler(controls);
                    controls.attachPlayer(this);
                    player_context = this;
                    try {
                        this.loadTorrent("http://content.torrent-tv.ru/cdn/223_all.acelive", {autoplay: true});
                    }
                    catch (e) {
                        console.log("init: " + e);
                    }
                },
                onError: function(err) {
                    console.log("init: error: " + err);
                    controls.onSystemMessage(err);
                }
            });
        }
        catch (e) {
            controls.onSystemMessage(e);
        }
    }
    </script>
```
