microsoft / AdaptiveCards

A new way for developers to exchange card content in a common and consistent way.
https://adaptivecards.io
MIT License
1.76k stars 552 forks source link

Media element CORS error #9061

Open IntranetFactory opened 5 days ago

IntranetFactory commented 5 days ago

Target Platforms

NodeJS

SDK Version

latest

Application Name

Adaptive Card designer & js viewer

Problem Description

I have a Media element with an mp3 for example from http://open.live.bbc.co.uk/mediaselector/6/redir/version/2.0/mediaset/audio-nondrm-download-rss/proto/http/vpid/p0k5xlhh.mp3

The file plays when using a plain <audio src="..."

When using it in a Media element it does not play and CORS error is showing in console. That is probably caused by the crossorigin attribute added by the Adaptive Card runtime.

How do I disable the unwanted attribute and/or play mp3 files hosted on servers which I do not control?

Screenshots

No response

Card JSON

.

Sample Code Language

No response

Sample Code

No response

IntranetFactory commented 5 days ago

Bug is caused by https://github.com/microsoft/AdaptiveCards/blame/main/source/nodejs/adaptivecards/src/card-elements.ts#L2901 where the crossorigin attribute is set unconditionally