任何人都可以帮我一个文件共享脚本?我如何让它流式传输视频?

时间:2013-04-02 09:10:52

标签: php video-streaming file-sharing

也许您已经听过像sockshare.com和putlocker.com这样的网站,我想要一个这样的网站,具有文件共享功能和视频共享,但我无法让它拥有视频功能,例如,如果用户上传视频然后必须进行流式传输,而不是要下载的文件。

请帮帮我,我不知道该怎么做。我不认为任何人都知道这样做的脚本...... :(

这是一些来源:

Home.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;

?>

1 个答案:

答案 0 :(得分:0)

您无法使用php流式传输视频,您需要使用jPlayer

之类的内容

我忘记了putlocker使用的内容,但它与jPlayer的想法相同。