Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rendering] Every other customMediaPlayer Video fails to initialise correctly #8374

Open
Proxatonin opened this issue Mar 21, 2023 · 0 comments · May be fixed by #8375
Open

[Rendering] Every other customMediaPlayer Video fails to initialise correctly #8374

Proxatonin opened this issue Mar 21, 2023 · 0 comments · May be fixed by #8375

Comments

@Proxatonin
Copy link

Proxatonin commented Mar 21, 2023

Target Platforms

NodeJS

SDK Version

1.5

Application Name

it's possible to replicate this issue here: https://adaptivecards.io/designer/ (this is where I took the screenshot)

Problem Description

Having more than one inline custom Media (youtube, vimeo, dailymotion) causes every second video to fail to render.

The issue is the use of global flags in the ICustomMediaPlayer urlPatterns, these are causing every other call to pattern.exec to fail to find matches (state is maintained as lastIndex until all instances are found, at which point a null is returned and the pattern state reset).
This causes every other video to default to use a HTML5MediaPlayer instead of the appropriate provider.

A quick fix would be to remove the global flags since each mediaSource only needs to contain one video url.

Screenshots

image

Card JSON

{
    "type": "AdaptiveCard",
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.5",
    "body": [
        {
            "type": "Media",
            "sources": [
                {
                    "url": "https://www.youtube.com/watch?v=awqTmdI6dRw"
                }
            ]
        },
        {
            "type": "Media",
            "sources": [
                {
                    "url": "https://www.youtube.com/watch?v=awqTmdI6dRw"
                }
            ]
        }
    ]
}

Sample Code Language

No response

Sample Code

No response

Proxatonin added a commit to Proxatonin/AdaptiveCards that referenced this issue Mar 21, 2023
this means every other call to exec will work without having to exhaust all matching instances from the previous call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant