0

Socksshare.com や putlocker.com などの Web サイトについて聞いたことがあるかもしれません。ファイル共有機能とビデオ共有機能を備えたそのようなサイトが必要ですが、ユーザーがアップロードした場合など、ビデオ機能を持たせることができません。ビデオの場合、ダウンロードするファイルとしてではなく、ストリーミングする必要があります。

どうすればいいのかわからない人たちを助けてください。これを行うスクリプトをすでに知っている人はいないと思います... :(

これはソースの一部です:

ホーム.php:

<?php
/*
    QMC (Quick Mini Core) by Alessandro Ubriaco
    http://core.seedfuse.com/
*/
define('CORE',1);
include_once 'inc/mcore.php';
$Core->Layout->begin();

$init = isset($_GET['init']) ? htmlspecialchars($_GET['init']) : 'home';

if(isset($_GET['exec']))
{
    $cname = 'com/'.basename($_GET['exec']).'.php';
    if(file_exists($cname))
        $Core->R = include($cname);
}

if(isset($_GET['req_name']))
{
    header('Cache-Control: no-cache, must-revalidate'); 
    $params = explode('_',$_GET['req_q']);
    $pname = 'pages/'.basename($params[0]).'.php';

    ob_start();
    if(file_exists($pname))
        include $pname;
    else
        echo 'Failed to load page.';
    $content = ob_get_contents();
    ob_end_clean();
    echo $Core->Lang->all($content);
    $Core->end();
}

echo <<<HTML
<div id="panel-dyn"></div>
<script type="text/javascript">
<!--

Index.php:

<?php
if(!defined('CORE'))
    exit(0);

if(isset($_SESSION['mc_admin']))
{
    include 'admin_home.php';
    return;
}

$js = <<<JS

        var swfu;

            var settings = {
                flash_url : 'flash/swfupload.swf',
                upload_url: '?exec=upload',
                post_params: {
                    '_sid' : '{$Core->SID}'
                    },
                file_size_limit : '10 MB',
                file_types : '*.*',
                file_types_description : 'All Files',
                file_upload_limit : 100,
                file_queue_limit : 0,
                custom_settings : {
                    progressTarget : 'fsUploadProgress',
                    cancelButtonId : 'btnCancel'
                },
                debug: false,

                button_image_url : 'images/buttons/upload-blue.png',
                button_placeholder_id : 'spanButtonPlaceholder',
                button_width: 140,
                button_height: 40,

                swfupload_loaded_handler : swfUploadLoaded,
                file_queued_handler : fileQueued,
                file_queue_error_handler : fileQueueError,
                file_dialog_complete_handler : fileDialogComplete,
                upload_start_handler : uploadStart,
                upload_progress_handler : uploadProgress,
                upload_error_handler : uploadError,
                upload_success_handler : uploadSuccess,
                upload_complete_handler : uploadComplete,
                queue_complete_handler : queueComplete,

                minimum_flash_version : '9.0.28',
                swfupload_pre_load_handler : swfUploadPreLoad,
                swfupload_load_failed_handler : swfUploadLoadFailed
            };

            swfu = new SWFUpload(settings);
this.style.display = 'none';
JS;

jspack($js);

echo <<<HTML

<form id="uploader" action="#" method="post" enctype="multipart/form-data">
    <fieldset>
        <legend>Uploader</legend>
        <div id="divSWFUploadUI">
            <div class="fieldset  flash" id="fsUploadProgress">
            <span class="legend">Upload Queue</span>
            </div>
            <p id="divStatus">0 Files Uploaded</p>
            <p>
                <span id="spanButtonPlaceholder"></span>
                <input id="btnCancel" type="button" value="Cancel All Uploads" disabled="disabled" style="display: none; margin-left: 2px; height: 22px; font-size: 8pt;" />
                <br />
            </p>
        </div>
        <noscript>
            <div style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px;">
                We're sorry.  Upload could not load.  You must have JavaScript enabled to enjoy Upload.
            </div>
        </noscript>
        <div id="divLoadingContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
            Upload is loading. Please wait a moment...
        </div>
        <div id="divLongLoading" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
            Upload is taking a long time to load or the load has failed.  Please make sure that the Flash Plugin is enabled and that a working version of the Adobe Flash Player is installed.
        </div>
        <div id="divAlternateContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
            We're sorry.  Upload could not load.  You may need to install or upgrade Flash Player.
            Visit the <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Adobe website</a> to get the Flash Player.
        </div>
    </fieldset>
    <p>This is a <b>DEMO</b>, database is wiped every 15 minutes except for users.</p>
    <div id="completed"></div>
</form>
<img src="images/loading.gif" border="0" alt="" onload="javascript:{$js}" />
HTML;

?>
4

1 に答える 1

0

PHP でビデオをストリーミングすることはできません。jPlayerのようなものを使用する必要があります。

putlocker が何を使っているかは忘れましたが、jPlayer と同じ考え方です。

于 2013-04-02T09:15:06.277 に答える