GithubHelp home page GithubHelp logo

Comments (3)

HamidrezaAmz avatar HamidrezaAmz commented on July 20, 2024 1

Hey @pateljigar7210
New version of MagicalExoPlayer released, now player support .mkv files, Just update ;)

from magicalexoplayer.

Inside4ndroid avatar Inside4ndroid commented on July 20, 2024

I have this issue when trying to play mkv files....

here is the erro log >

2020-07-08 15:17:07.448 22820-23082/com.app.strix E/ExoPlayerImplInternal: Source error com.google.android.exoplayer2.ParserException: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT @1:385 in java.io.InputStreamReader@dadf4b5) at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:96) at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:61) at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:172) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT @1:385 in java.io.InputStreamReader@dadf4b5) at org.kxml2.io.KXmlParser.readEntity(KXmlParser.java:1220) at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1402) at org.kxml2.io.KXmlParser.next(KXmlParser.java:393) at org.kxml2.io.KXmlParser.next(KXmlParser.java:313) at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:89) at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:61)  at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:172)  at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:764) 

from magicalexoplayer.

Inside4ndroid avatar Inside4ndroid commented on July 20, 2024

Whoops i fixed it lol...

for those who would like to know how

first add this line to PublicValues.java in the utils folder >

public static final String KEY_MKV = "mkv";

now in the AndExoPlayerView add this the the MediaSource buildMediaSource method >

else if (validUrl && uri.getLastPathSegment().contains(PublicValues.KEY_MKV)) {

            DefaultHttpDataSourceFactory sourceFactory = new DefaultHttpDataSourceFactory(PublicValues.KEY_USER_AGENT);
            if (extraHeaders != null) {
                for (Map.Entry<String, String> entry : extraHeaders.entrySet())
                    sourceFactory.getDefaultRequestProperties().set(entry.getKey(), entry.getValue());
            }

            return new ProgressiveMediaSource.Factory(sourceFactory)
                    .createMediaSource(uri);

        } else if (!validUrl && uri.getLastPathSegment().contains(PublicValues.KEY_MKV)) {
            return new ProgressiveMediaSource.Factory(new DefaultDataSourceFactory(context, PublicValues.KEY_USER_AGENT))
                    .createMediaSource(uri);

        }

now when you pass an mkv url as source it will play without any issues :)

Happy coding :)

from magicalexoplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.