Skip to content

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

Open
@Proxatonin

Description

@Proxatonin

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions