0

也许您听说过 sockshare.com 和 putlocker.com 之类的网站,我想要一个具有文件共享功能和视频共享功能的网站,但我就是无法让它具有视频功能,例如,如果用户上传一个视频,那么它必须是流式传输的,而不是作为要下载的文件。

请帮帮我,我不知道该怎么做。我不认为有人知道这样做的脚本已经如此...... :(

这是一些来源:

主页.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">
<!--

索引.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 回答