Архив форума Ace Stream

Для разработчиков => Проблемы и решения => Тема начата: Deus от 10 Мая 2016, 12:21:38

Название: Проблема при встраивании плеера на страницу - failed to open transport file
Отправлено: Deus от 10 Мая 2016, 12:21:38
При встраивании плеера на страницу и вставке ссылки на свой торрент файл возникает следующая ошибка:

failed to open transport file

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

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

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

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

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

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

<script src="//releases.flowplayer.org/js/flowplayer-3.2.13.min.js"></script>
        <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>