从不在webroot中的目录播放视频

时间:2017-04-08 23:02:51

标签: html5 iis web

我可以将视频文件从IIS Web服务器播放到客户端Web应用程序,只要它们位于服务器上的webroot目录中即可。但是,我想从不在webroot中的共享目录中播放它们。这可能吗?? 调用视频文件的Javascript函数,视频是共享名称:

function loadAnotherVideo() {
var video = document.getElementById("video");
var source = document.getElementById("fileSelector");
var path = "//192.168.0.18/Videos/" + source.value;
alert(path);
video.src = path;
video.load();
video.play();

}

1 个答案:

答案 0 :(得分:0)

您应该可以执行此类操作,只需确保应用程序池对存储文件的文件夹具有读取权

├── cli-config.php
├── composer.json
├── composer.lock
├── CONTRIBUTING.md
├── EXPORT
│   ├── Companies.php
│   ├── CompaniesPlansPayments.php
│   ├── CompaniesPlans.php
│   ├── DepartmentsCoordinators.php
│   ├── Departments.php
│   ├── InterventionclasificationDetails.php
│   ├── Interventionclasifications.php
│   ├── Interventionrelations.php
│   ├── Interventions.php
│   ├── InterventiontypesCompanies.php
│   ├── Interventiontypes.php
│   ├── Locations.php
│   ├── LocationTypes.php
│   ├── Managementreview.php
│   ├── Managementreviewrelations.php
│   ├── Plans.php
│   ├── ServicelinesManagers.php
│   ├── Servicelines.php
│   ├── Users.php
│   └── Usertypes.php
├── logs
│   ├── app.log
│   └── README.md
├── nbproject
│   ├── private
│   │   └── private.properties
│   ├── project.properties
│   └── project.xml
├── phpunit.xml
├── public
│   └── index.php
├── README.md
├── src
│   ├── Action
│   │   └── InterventionsAction.php
│   ├── dependencies.php
│   ├── Entity
│   │   ├── Companies.php
│   │   ├── CompaniesPlansPayments.php
│   │   ├── CompaniesPlans.php
│   │   ├── DepartmentsCoordinators.php
│   │   ├── Departments.php
│   │   ├── InterventionclasificationDetails.php
│   │   ├── Interventionclasifications.php
│   │   ├── Interventionrelations.php
│   │   ├── Interventions.php
│   │   ├── InterventiontypesCompanies.php
│   │   ├── Interventiontypes.php
│   │   ├── Locations.php
│   │   ├── LocationTypes.php
│   │   ├── Managementreview.php
│   │   ├── Managementreviewrelations.php
│   │   ├── Plans.php
│   │   ├── ServicelinesManagers.php
│   │   ├── Servicelines.php
│   │   ├── Users.php
│   │   └── Usertypes.php
│   ├── middleware.php
│   ├── routes.php
│   └── settings.php
├── templates
│   └── index.phtml
├── tests
│   └── Functional
│       ├── BaseTestCase.php
│       └── HomepageTest.php
└── vendor
    ├── autoload.php
    ├── bin
    │   ├── doctrine -> ../doctrine/orm/bin/doctrine
    │   ├── doctrine-dbal -> ../doctrine/dbal/bin/doctrine-dbal
    │   ├── doctrine.php -> ../doctrine/orm/bin/doctrine.php
    │   └── phpunit -> ../phpunit/phpunit/phpunit
    ├── composer
    │   ├── autoload_classmap.php
    │   ├── autoload_files.php
    │   ├── autoload_namespaces.php
    │   ├── autoload_psr4.php
    │   ├── autoload_real.php
    │   ├── ClassLoader.php
    │   ├── installed.json
    │   └── LICENSE
    ├── container-interop
    │   └── container-interop
    ├── doctrine
    │   ├── annotations
    │   ├── cache
    │   ├── collections
    │   ├── common
    │   ├── dbal
    │   ├── inflector
    │   ├── instantiator
    │   ├── lexer
    │   └── orm
    ├── monolog
    │   └── monolog
    ├── myclabs
    │   └── deep-copy
    ├── nikic
    │   └── fast-route
    ├── phpdocumentor
    │   ├── reflection-common
    │   ├── reflection-docblock
    │   └── type-resolver
    ├── phpspec
    │   └── prophecy
    ├── phpunit
    │   ├── php-code-coverage
    │   ├── php-file-iterator
    │   ├── php-text-template
    │   ├── php-timer
    │   ├── php-token-stream
    │   ├── phpunit
    │   └── phpunit-mock-objects
    ├── pimple
    │   └── pimple
    ├── psr
    │   ├── container
    │   ├── http-message
    │   └── log
    ├── sebastian
    │   ├── code-unit-reverse-lookup
    │   ├── comparator
    │   ├── diff
    │   ├── environment
    │   ├── exporter
    │   ├── global-state
    │   ├── object-enumerator
    │   ├── recursion-context
    │   ├── resource-operations
    │   └── version
    ├── slim
    │   ├── php-view
    │   └── slim
    ├── symfony
    │   ├── console
    │   ├── debug
    │   ├── polyfill-mbstring
    │   └── yaml
    └── webmozart
        └── assert
File - video.aspx
private void Page_Load(object sender, System.EventArgs e)
{
    //Set the appropriate ContentType.
    Response.ContentType = "video/mp4";

    //Get the physical path to the file.
    string FilePath = "c:\path-to-video\video.mp4";

    //Write the file directly to the HTTP content output stream.
    Response.WriteFile(FilePath);

    Response.End();
}
HTML

基于评论

这是一篇展示如何使用javascript设置/更改视频源的帖子:

相关问题