简体   繁体   中英

Play Adobe media server in Asp.net core 2.2 web Application

I have web application with asp.net core 2.2. this application is a client for a Api server

i'm using adobe media server 5 for video streaming and my stream urls is like

this: http://localhost/hls-vod/sample1_150kbps.f4v.m3u8

I play that link with hls.js

but i get this Error

Access to XMLHttpRequest at ' http://localhost/hls-vod/sample1_150kbps.f4vFrag1Num0.ts ' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

follow solutions are not working for me :

https://community.adobe.com/t5/media-server/how-to-allow-cors-request-from-javascript/td-p/8691655

How to allow CORS request from Javascript in Adobe Media Server

is there better solution for playing media server stream in asp.net core web applications?

I Add Access-Control-Allow-Origin: * in Apache config file but still not working

curl -I http://localhost/hls-vod/program/csshtmlcourse/01.mp4.m3u8

and

HTTP/1.1 200 OK
Date: Sun, 02 Feb 2020 07:26:35 GMT
Server: Apache/2.2.21 (Win32) DAV/2
Cache-Control: max-age=86400,public,must-revalidate,proxy-revalidate,no-transform
Expires: Mon, 03 Feb 2020 07:26:35 GMT
Content-Length: 4575
Last-Modified: Wed, 04 Sep 2019 02:56:00 GMT
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Content-Type: application/vnd.apple.mpegurl

the problem was about my urls i will change slash or backslash

this work for some videos but other still not working and i found that

other video must be converted

ffmpeg-20190709-5a481b1-win64-static

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM