Using flex to play videos from a Windows shared folder

I need to play a video file from a Windows shared folder inside a corporate network. Share is used because it is replicated on other corporate sites, so each user can download local storage video from it (we use DFS for it).

Video must be played on our web portal. Therefore, I want to use Flex for this task.

The question arises: how to share Windows from flex.

If you can offer a different solution, that would also be great.

Thanks!

+4
source share
1 answer

You may need a file path as follows:

file:///\\myserver\myfolder\myvideofile.avi 

If not, you may need Filestream video in your application, for example:

 private function init() : void { file = new File("\\myserver\myfolder\myvideofile.avi"); fileStream = new FileStream(); fileStream.addEventListener( Event.COMPLETE, fileComplete ); fileStream.openAsync( file, FileMode.READ ); } private function fileComplete( event : Event ):void { fileContents = fileStream.readMultiByte( fileStream.bytesAvailable, ISO_CS ); fileStream.close(); } 

You may also need to refer to your โ€œcross-domain policy policy fileโ€ if you are trying to access anything outside of your SWF sandbox. Loading remote assets can be complex (and a nightmare of security configuration) in FLEX.

 <?xml version="1.0"?> <!-- http://www.foo.com/crossdomain.xml --> <cross-domain-policy> <site-control permitted-cross-domain-policies="by-content-type"/> <allow-access-from domain="www.friendOfFoo.com"/> <allow-access-from domain="*.foo.com"/> <allow-access-from domain="105.216.0.40"/> </cross-domain-policy> 

You may need to read about Adobe's cross-domain policy here.

0
source

Source: https://habr.com/ru/post/1443195/


All Articles