Skip to content

Standalone player exports unsupported by IE11 #954

Description

@jchi2241

Current Behavior

If exporting standalone player exports (youtube, wistia, Soundcloud, etc...) and not react-player, Internet Explorer 11 errors because it does not recognize es6 syntax in the imported files.

e.g.,

import WistiaPlayer from "react-player/wistia";

results in a console error SCRIPT1010 Expected Identifier, pointing to a non-transpiled version of react-player/wistia.js

const { createReactPlayer } = require('./lib/ReactPlayer') <<< errors on this line
const Player = require('./lib/players/Wistia').default                               
module.exports = createReactPlayer([Player])

Importing just react-player works just fine since its pointing to a fully transpiled version of the lib at lib/index.js. e.g.,

import ReactPlayer from "react-player";

However, ideally I'd like to not have to do this to reduce the bundle size.

Expected Behavior

Be able to pick and choose imports and have it supported by IE11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions