IntroductionHow to add CSS or JavaScript files to an Android/iOS projectHow to combat autoplay policiesPlayback issue with Internet Explorer 11Why does fullscreen not behave as expected on iOSWhy does the network API not work on iOS devicesWhy doesn't Chromecast work when embedded in an iframe on iOSWhy can't I select another video quality on iOSIs YouTube supportedWhy does the player load only one audio track (even though there are several in the manifest)Is it possible to see 360 degrees photo with THEOplayerWhy the visibility API does not work through an iframe on Safari and IE11What is an impressionHow to know whether a live stream is playingWhich error related events does the player exposeWhy did my subtitles stop workingHow does Media Engagement Index (MEI) affect Autoplay on ChromeWhat does the error message 'Unknown CDM error' meanWhat does the error message 'Something went wrong with Native playback' meanWhy are not all response headers exposedWhy does the currentTime seem off in my livestream & what can I do about itHow to remove CORS restrictions from a reproduction streamWhich network calls (or requests) does THEOplayer doWhy does the playback not work when using the Chrome iPhone/iPad simulatorWhat does the error message 'can only be initiated by a user gesture' imply? Can I still force the desired actionHow to remove unwanted CC track in iOS or SafariKnown Chromecast Limitations in 2.61.1What are the Product Flavor options in the Android SDK (minApi16 and minApi21)Why do I get a grey play button in my Android WebView and how to remove it?I'm unable to inspect Webview with the Android SDKMediaTek limitationsHow to fix Android DRM in Chrome 74How to use ProGuard with THEOplayer Android SDKSelf-hosting and versioning of THEOplayerDoes THEOplayer support EXT-X-DATERANGECan clipping be used on a playlistCan timeline thumbnails be made available before playback startWhat are the benefits of preloadingWhat are the player seeking and seeked events and when are they firedCan we use HLS or DASH adsHow to change text in THEOplayerChange text when AirplayingITP2.1 problems using THEOplayerRemoving context menu/'Powered by THEOplayer v2...'What aspects of THEOplayer do we need to take into account to deploy a proper Content Security Policy (CSP)How can we avoid that the player keeps looking for chunks/segments if they are not foundCan we show a custom message on 403 on mp4Can we prevent UpNext feature from redirectingIs it possible to preload VOD content while the pre-roll is playingWhy is my video not playing automaticallyIs it possible to have multiple player instances play at the same timeIs it a problem if the viewer pauses a live stream for longer than the DVR windowTHEOplayer Features & ModulesChromecast on my webplayer does not work any longer despite no change in my implementationHow to track network errorsWhat is the support for WowzaHow to use the CDN fallback/backup stream featureHow to apply accurate buffering strategyHow can I distribute 4K content?What is the collaboration between Azure Media Services and THEOplayerIs Portrait mode supportedHow to prevent screen recordingThe provided video source is incompatible with the license for this playerPage and Source domainsWhat does the error message “Something went wrong determining the initial period of the provided MPEG-DASH stream” meanWhy is my Playready stream not working in Chromium Edge?Which subtitle and CC formats are supported on native SafariHow to navigate through the documentation and resourcesHow to create a (great) ticketHow to investigate a ticketWhat are the limitations of AirPlayWhat are the Edgecast challengesHow to use the Media Session APIHow to use THEOplayer iOS SDK on an M1 mac

MediaTek limitations

This page overviews a list of known issues caused by the MediaTek chipset.

1. Switching to fullscreen halts playback for approximately 10 seconds

The MediaTek decoder seems lackluster at handling a transition to fullscreen when experimental rendering is enabled because THEOplayer uses a separate Android Activity for fullscreen. Using the default rendering pipeline does not trigger this issue. A workaround is doing fullscreen without detaching the SurfaceView from the window.

Why does THEOplayerView uses a separate activity for fullscreen?

THEOplayerView uses a separate Activity for fullscreen so that the fullscreen view is completely isolated from the Activity the THEOplayerView is in. The Activity has its own orientation, window settings, and back button behaviour. By using a separate Activity, we can leave those settings and the view hierarchy intact in the Activity in which the THEOplayerView is embedded.

A downside of this in case of experimental rendering is that we need to move the SurfaceView that holds the Surface on which video is rendered. This however means that a the Surface is destroyed and a new one is created. On newer devices, this is normally no problem because the decoder is decoupled from the Surface. When the Surface is destroyed, a new one can be attached to the same decoder. On devices with an api lower than 23 (and some other devices which bug) however, the decoder can not change the Surface on which it draws without re-initialization. This means that on older and some buggy devices, switching to fullscreen will make the video hang until the next keyframe is reached in the stream.

Solution: Fullscreen without detaching the SurfaceView from the window

If an implementer does not want the Surface to be destroyed when going fullscreen, the implementer needs to implement this themself to fit within the Activity.

A few things are needed for this:

  1. FullscreenCoupling needs to be disabled (with getTPV().getSettings().setFullScreenOrientationCoupled(false)).
  2. If the UI is enabled, the fullscreen button needs to be hidden or overwritten. This needs to be done with custom CSS and/or custom JavaScript.
  3. Orientation needs to be handled in the Activity. 3.1 To change the orientation of the Activity, setRequestedOrientation has to be called on the Activity or the Activity needs to be allowed to rotate. Allowing the acitivity to rotate means that the android:screenOrientation property in the manifest needs to be set to multiple values or not set. 3.2 To make sure that the Activity is not recreated on an orientationchange,android:configChanges field in the manifest need to include "orientation|screenSize". 3.3 To detect the change, the onConfigurationChanged method needs to be overridden in the Activity. In the implementation the orientation can be checked and fullscreen can be initiated or stopped depending on it.
  4. To make the THEOplayerView fill the whole Activity without moving the view, the THEOplayerView and all of its parents view's width and height layout parameters need to be set to "match_parent" and they all need to be the first child-view (with a non-zero surface area).
  5. To hide the navigation buttons and status bar, the Activity should change the window and visibility flags. this can be done with: 5.1 getWindow().getDecorView().setSystemUiVisibility(SYSTEMUIFLAGLOWPROFILE|SYSTEMUIFLAGFULLSCREEN|SYSTEMUIFLAGLAYOUTSTABLE| SYSTEMUIFLAGIMMERSIVESTICKY|SYSTEMUIFLAGLAYOUTHIDENAVIGATION|SYSTEMUIFLAGHIDENAVIGATION); 5.2 getWindow().setFlags(FLAGFULLSCREEN, FLAGFULLSCREEN);
  6. To let the player exit fullscreen on a back button press instead of stopping the Activity, the onBackPressed method of the Activity should be overridden with the desired behaviour.
  7. When going back from fullscreen, the original settings for the window and back button behaviour need to be set back to desired values.
Make sure to follow us on GitHub!
Copyright © 2022. All Rights Reserved.
New York