GithubHelp home page GithubHelp logo

fenster's Introduction

Fenster

A library to display videos in a TextureView using a custom MediaPlayer controller as described in this blog post http://www.malmstein.com/blog/2014/08/09/how-to-use-a-textureview-to-display-a-video-with-custom-media-player-controls/

Demo gif

Install

Download

To get the current snapshot version:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.malmstein:fenster:0.0.2'
    }
}

minSDK

The minSDK for the use of the library is minSDK 16

Displaying a video with custom controller

Add a TextureVideoView and a PlayerController to your Activity or Fragment

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/default_bg"
  tools:context=".DemoActivity">

  <com.malmstein.fenster.view.FensterVideoView
    android:id="@+id/play_video_texture"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:keepScreenOn="true"
    android:fitsSystemWindows="true" />

  <com.malmstein.fenster.controller.MediaFensterPlayerController
    android:id="@+id/play_video_controller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:animateLayoutChanges="true"
    android:fitsSystemWindows="true" />

</FrameLayout>

Setting video URL

In order to display a video, simply set the video URL and call start. You can also start the video from a desired second too.

@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);

    textureView = (TextureVideoView) findViewById(R.id.play_video_texture);
    playerController = (PlayerController) findViewById(R.id.play_video_controller);

    textureView.setMediaController(playerController);

    textureView.setVideo("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",
                PlayerController.DEFAULT_VIDEO_START);
    textureView.start();
}

Exposed listeners

By default there are the exposed listeners. The NavigationListener will listen to the to Previous and Next events triggered by the controller. The VisibilityListener will be triggered when the PlayerController visibility changes.

playerController.setNavigationListener(this);
playerController.setVisibilityListener(this);

Using the Gesture Detection Player Controller

Attach a listener to your player controller

As described in this blog post http://www.malmstein.com/how-to-use-a-textureview-to-display-a-video-with-custom-media-player-controls/ it's very simple to use. Just add a listener to Player Controller

playerController.setFensterEventsListener(this);

The Fenster Events Listener allows you to react to the gestures

public interface FensterEventsListener {

    void onTap();

    void onHorizontalScroll(MotionEvent event, float delta);

    void onVerticalScroll(MotionEvent event, float delta);

    void onSwipeRight();

    void onSwipeLeft();

    void onSwipeBottom();

    void onSwipeTop();
}

Use MediaPlayerController instead of SimpleMediaPlayerController

MediaFensterPlayerController also shows volume and brightness controls, if you just want to use a simple media controller then the recommendation is to use SimpleMediaFensterPlayerController

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/default_bg"
  tools:context=".DemoActivity">

  <com.malmstein.fenster.view.FensterVideoView
    android:id="@+id/play_video_texture"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:keepScreenOn="true"
    android:fitsSystemWindows="true" />

  <com.malmstein.fenster.controller.SimpleMediaFensterPlayerController
    android:id="@+id/play_video_controller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:animateLayoutChanges="true"
    android:fitsSystemWindows="true" />

</FrameLayout>

Using the Volume and Brightness Seekbar

Add them to your layout:

  <com.malmstein.fenster.seekbar.BrightnessSeekBar
    android:id="@+id/media_controller_volume"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
  <com.malmstein.fenster.seekbar.VolumeSeekBar
    android:id="@+id/media_controller_volume"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

Initialise them from your Fragment or Activity:

mVolume = (VolumeSeekBar) findViewById(R.id.media_controller_volume);
mVolume.initialise(this);

mBrightness = (BrightnessSeekBar) findViewById(R.id.media_controller_brightness);
mBrightness.initialise(this);

You'll get a callback when the seekbar is being dragged:

@Override
public void onVolumeStartedDragging() {
    mDragging = true;
}

@Override
public void onVolumeFinishedDragging() {
    mDragging = false;
}

@Override
public void onBrigthnessStartedDragging() {
    mDragging = true;
}

@Override
public void onBrightnessFinishedDragging() {
    mDragging = false;
}

Support for different video origins

The setVideo() method allows you to load remote or local video files. You can also set the start time of the video (useful if you want to resume content), passing in a integer which corresponds to Milliseconds.

Loading a remote stream

@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);

    textureView = (TextureVideoView) findViewById(R.id.play_video_texture);
    playerController = (PlayerController) findViewById(R.id.play_video_controller);

    textureView.setMediaController(playerController);

    textureView.setVideo("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4");
    textureView.start();
}

Loading a local stream

Fenster uses the AssetFileDescriptor in order to load a local video stream.

@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);

    textureView = (TextureVideoView) findViewById(R.id.play_video_texture);
    playerController = (PlayerController) findViewById(R.id.play_video_controller);

    textureView.setMediaController(playerController);
    
    AssetFileDescriptor assetFileDescriptor = getResources().openRawResourceFd(R.raw.big_buck_bunny);
    textureView.setVideo(assetFileDescriptor);
   
    textureView.start();
}

Support for video scaling modes

Sets video scaling mode. To make the target video scaling mode effective during playback, the default video scaling mode is VIDEO_SCALING_MODE_SCALE_TO_FIT. Uses setVideoScalingMode

There are two different video scaling modes: scaleToFit and crop

In order to use it, Fenster allows you to pass in an argument from the xml layout:

<com.malmstein.fenster.view.FensterVideoView
  android:id="@+id/play_video_texture"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  app:scaleType="crop" />

License

(c) Copyright 2016 David Gonzalez

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

fenster's People

Contributors

malmstein avatar pavelsynek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fenster's Issues

Issue with gradle sync

https://oss.sonatype.org/content/repositories/snapshots/com/malmstein/ does not have fenster directory.
While compiling it is trying to find fenster directory but it it not there. Hence giving following error:

Error:Could not find com.malmstein:fenster:0.1-SNAPSHOT.
Searched in the following locations:
file:/home/pc-name/android-studio/gradle/m2repository/com/malmstein/fenster/0.1-SNAPSHOT/maven-metadata.xml
file:/home/pc-name/android-studio/gradle/m2repository/com/malmstein/fenster/0.1-SNAPSHOT/fenster-0.1-SNAPSHOT.pom
file:/home/pc-name/android-studio/gradle/m2repository/com/malmstein/fenster/0.1-SNAPSHOT/fenster-0.1-SNAPSHOT.jar
https://repo1.maven.org/maven2/com/malmstein/fenster/0.1-SNAPSHOT/maven-metadata.xml
https://repo1.maven.org/maven2/com/malmstein/fenster/0.1-SNAPSHOT/fenster-0.1-SNAPSHOT.pom
https://repo1.maven.org/maven2/com/malmstein/fenster/0.1-SNAPSHOT/fenster-0.1-SNAPSHOT.jar
https://oss.sonatype.org/content/repositories/snapshots/com/malmstein/fenster/0.1-SNAPSHOT/maven-metadata.xml
https://oss.sonatype.org/content/repositories/snapshots/com/malmstein/fenster/0.1-SNAPSHOT/fenster-0.1-SNAPSHOT.pom
https://oss.sonatype.org/content/repositories/snapshots/com/malmstein/fenster/0.1-SNAPSHOT/fenster-0.1-SNAPSHOT.jar
Required by:
pc-name2:app:unspecified

Gradle Sync Issue

Hi Malmstein,
When i have imported the project i have gradle sync issue . please help me .

width not obey the layout settings used in recylcerview

@malmstein
I tried to use FensterVideoView in recyclerview

            <com.malmstein.fenster.view.FensterVideoView
                android:id="@+id/daily_item_list_item_play_video_view"
                android:layout_width="match_parent"
                android:layout_height="@dimen/list_item_default_height"
                android:background="@android:color/black"
                android:keepScreenOn="true" />

            <com.malmstein.fenster.controller.MediaFensterPlayerController
                android:id="@+id/daily_item_list_item_play_video_controller"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:animateLayoutChanges="true" />

        </FrameLayout>

after loading the video width change to a smaller one not obey match_parent settings
http://image.cdn.daily.prototypeplus.org/image%2F2015%2F12%2F21%2Fbug.png

Video library crash while playing video

Hello guys,
I am facing some issue while playing video on my app
it was working fine but suddenly after 10min player will get crashed with error

2019-01-01 15:22:00.292 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus Failed to readFile
2019-01-01 15:22:00.293 1268-14485/? E/MM_OSAL: Read File Error!
2019-01-01 15:22:00.293 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus VIDEO_FMT_FAILURE
2019-01-01 15:22:00.331 1268-14485/? E/MM_OSAL: Mpeg4File::getSample FATAL starting at 11889671, size 734
2019-01-01 15:22:01.003 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus Failed to readFile
2019-01-01 15:22:01.003 1268-14485/? E/MM_OSAL: Read File Error!
2019-01-01 15:22:01.003 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus VIDEO_FMT_FAILURE
2019-01-01 15:22:01.003 1268-14485/? E/MM_OSAL: Mpeg4File::getSample FATAL starting at 11889671, size 734
2019-01-01 15:22:01.008 1270-2751/? E/NuPlayerDecoder: Stream error for [OMX.google.aac.decoder] (err=-1004), EOS successfully queued
2019-01-01 15:22:01.009 1270-2734/? E/NuPlayer: received error(0xfffffc14) from audio decoder, flushing(0), now shutting down
2019-01-01 15:22:01.010 1270-2751/? E/NuPlayerDecoder: Stream error for [OMX.google.aac.decoder] (err=-1004), EOS successfully queued
2019-01-01 15:22:01.014 1270-2734/? E/NuPlayer: received error(0xfffffc14) from audio decoder, flushing(2), now shutting down
2019-01-01 15:22:01.139 1262-2760/? E/AudioFlinger: Error when pausing output stream: -38
2019-01-01 15:22:01.147 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus Failed to readFile
2019-01-01 15:22:01.147 1268-14485/? E/MM_OSAL: Read File Error!
2019-01-01 15:22:01.147 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus VIDEO_FMT_FAILURE
2019-01-01 15:22:01.147 1268-14485/? E/MM_OSAL: Mpeg4File::getSample FATAL starting at 14788064, size 54542
2019-01-01 15:22:01.211 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus Failed to readFile
2019-01-01 15:22:01.211 1268-14485/? E/MM_OSAL: Read File Error!
2019-01-01 15:22:01.211 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus VIDEO_FMT_FAILURE
2019-01-01 15:22:01.211 1268-14485/? E/MM_OSAL: Mpeg4File::getSample FATAL starting at 14788064, size 54542
2019-01-01 15:22:01.243 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus Failed to readFile
2019-01-01 15:22:01.243 1268-14485/? E/MM_OSAL: Read File Error!
2019-01-01 15:22:01.243 1268-14485/? E/MM_OSAL: Mpeg4File::mp4ReadStatus VIDEO_FMT_FAILURE
2019-01-01 15:22:01.243 1268-14485/? E/MM_OSAL: Mpeg4File::getSample FATAL starting at 14788064, size 54542
2019-01-01 15:22:01.272 1270-2749/? E/NuPlayerDecoder: Stream error for [OMX.qcom.video.decoder.avc] (err=-1004), EOS successfully queued
2019-01-01 15:22:01.272 1270-2734/? E/NuPlayer: received error(0xfffffc14) from video decoder, flushing(0), now shutting down
2019-01-01 15:22:01.274 987-2763/app.android.apnacourse E/MediaPlayerNative: error (1, -1004)
2019-01-01 15:22:01.275 987-987/app.android.apnacourse E/MediaPlayer: Error (1,-1004)
2019-01-01 15:22:01.280 987-987/app.android.apnacourse E/TextureVideoView: TextureVideoView error. File or network related operation errors.
2019-01-01 15:22:01.295 987-987/app.android.apnacourse E/TextureVideoView: TextureVideoView error. Unspecified media player error.
2019-01-01 15:22:03.099 987-3117/app.android.apnacourse E/Buffer Error: Error: java.lang.NullPointerException
2019-01-01 15:22:13.009 987-3121/app.android.apnacourse E/Buffer Error: Error: java.lang.NullPointerException
2019-01-01 15:22:23.272 987-3125/app.android.apnacourse E/Buffer Error: Error: java.lang.NullPointerException
2019-01-01 15:22:33.161 987-3129/app.android.apnacourse E/Buffer Error: Error: java.lang.NullPointerException
2019-01-01 15:22:40.942 2930-32716/? E/NetworkScheduler.ATC: Called cancelTask for already completed task com.google.android.gms/.learning.training.background.TrainingGcmTaskService{u=0 tag="com.google.android.gms.learning.BACKGROUND_TRAINING_TASK" trigger=window{period=900s,flex=600s,earliest=-134s,latest=465s} requirements=[NET_ANY,CHARGING,DEVICE_IDLE] attributes=[PERSISTED,RECURRING] scheduled=-434s last_run=0s jid=N/A status=ACTIVE retries=0 client_lib=MANCHEGO_GCM-14799000} :RESCHEDULED
2019-01-01 15:22:41.651 3145-3145/? E/System: Ignoring attempt to set property "java.net.preferIPv6Addresses" to value "false".
2019-01-01 15:22:43.072 987-3213/app.android.apnacourse E/Buffer Error: Error: java.lang.NullPointerException
2019-01-01 15:22:45.787 32396-3231/? E/WakePathManager: UpdateWakePathTask.doInBackground: isWifiNetwork==false

Can we load the video present in local system?

I am capturing video from video camera, and I view it before uploading. and I'm using SimpleMediaFensterPlayerController. its not playing the video.
is it possible to play the video captured and stored in local system

Gradle?

Hi,

Do you have Gradle dependency set for this library? I am having issues in setting Maven... :(

Your library seems promising and I could not get a SO links discussing about this.

MediaController and Brightness not Working

I had tried to implement the media controller but other other than play/ pause button no other button like forward, backward media button is not working and also the brightness seekbar had no effect on screen.

showing error java.lang.UnsupportedOperationException: Unsupported Service: audio in xml preview

java.lang.UnsupportedOperationException: Unsupported Service: audio   at com.android.layoutlib.bridge.android.BridgeContext.getSystemService(BridgeContext.java:602)   at com.malmstein.fenster.seekbar.VolumeSeekBar.initialise(VolumeSeekBar.java:78)   at com.malmstein.fenster.controller.MediaFensterPlayerController.initControllerView(MediaFensterPlayerController.java:205)   at com.malmstein.fenster.controller.MediaFensterPlayerController.onFinishInflate(MediaFensterPlayerController.java:174)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:867)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)   at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)   at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)   at android.view.LayoutInflater.inflate(LayoutInflater.java:518)   at android.view.LayoutInflater.inflate(LayoutInflater.java:397) Copy stack to clipboard Tip: Try to refresh the layout.

Video can't be resized

Hi,

I am using this Library & trying to set the Video vertically. the Video is running fine however, its size is fixed. Tried many things but not able to alter the height of the video. I want to run video vertically in the background & next few things will be displayed over it.

screenshot

release() the Surface?

I am seeing StrictMode complaints coming from FensterVideoView, in version 0.0.2 of your library:

E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
              java.lang.Throwable: Explicit termination method 'release' not called
                  at dalvik.system.CloseGuard.open(CloseGuard.java:180)
                  at android.view.Surface.setNativeObjectLocked(Surface.java:459)
                  at android.view.Surface.<init>(Surface.java:145)
                  at com.malmstein.fenster.view.FensterVideoView.openVideo(FensterVideoView.java:260)
                  at com.malmstein.fenster.view.FensterVideoView.access$2100(FensterVideoView.java:50)
                  at com.malmstein.fenster.view.FensterVideoView$8.onSurfaceTextureAvailable(FensterVideoView.java:553)

This appears to be coming from mMediaPlayer.setSurface(new Surface(mSurfaceTexture)). I do not see where you are releasing that Surface.

Thanks!

error when adding to fragment

E/UncaughtException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getScheme()' on a null object reference
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:972)
at com.malmstein.fenster.view.FensterVideoView.setDataSource(FensterVideoView.java:281)
at com.malmstein.fenster.view.FensterVideoView.openVideo(FensterVideoView.java:257)
at com.malmstein.fenster.view.FensterVideoView.access$2100(FensterVideoView.java:50)
at com.malmstein.fenster.view.FensterVideoView$8.onSurfaceTextureAvailable(FensterVideoView.java:553)
at android.view.TextureView.getHardwareLayer(TextureView.java:370)
at android.view.View.updateDisplayListIfDirty(View.java:14059)
at android.view.View.getDisplayList(View.java:14105)
at android.view.View.draw(View.java:14872)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14077)
at android.view.View.getDisplayList(View.java:14105)
at android.view.View.draw(View.java:14872)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14077)
at android.view.View.getDisplayList(View.java:14105)
at android.view.View.draw(View.java:14872)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.draw(View.java:15151)
at android.widget.FrameLayout.draw(FrameLayout.java:592)
at android.widget.ScrollView.draw(ScrollView.java:1718)
at android.view.View.updateDisplayListIfDirty(View.java:14082)
at android.view.View.getDisplayList(View.java:14105)
at android.view.View.draw(View.java:14872)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14077)
at android.view.View.getDisplayList(View.java:14105)
at android.view.View.draw(View.java:14872)
at android.view.ViewGroup.drawChild(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
at android.view.View.updateDisplayListIfDirty(View.java:14077)
at android.view.View.getDisplayList(View.java:14105)
at android.view.View.draw(View.java:14872)

Wanted to try the lib but sample project crashed with java.lang.SecurityException

I did set the following permission in my AndroidManifest.xml

art : Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
02-24 18:21:01.818 2262 3455 E GFEEDBACK_ErrorReportUtil: Error trying to add app version info for com.google.android.webview
02-24 18:21:01.826 1535 1558 I Choreographer: Skipped 45 frames! The application may be doing too much work on its main thread.

java.lang.SecurityException: net.fenstertest was not granted this permission: android.permission.WRITE_SETTINGS.
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at android.provider.Settings.isCallingPackageAllowedToPerformAppOpsProtectedOperation(Settings.java:9651)
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at android.provider.Settings.checkAndNoteWriteSettingsOperation(Settings.java:9533)
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at com.android.providers.settings.SettingsProvider.mutateSystemSetting(SettingsProvider.java:1068)
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at com.android.providers.settings.SettingsProvider.insertSystemSetting(SettingsProvider.java:1043)
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:294)
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at android.content.ContentProvider$Transport.call(ContentProvider.java:400)
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:283)
02-24 18:21:01.875 1535 1650 E DatabaseUtils: at android.os.Binder.execTransact(Binder.java:565)

Improvement/bugfix for SimpleMediaFensterPlayerController

  1. Bug: Currently this Controller does not handle the rewind/forward button clicks... They simple don't have click listeners and do nothing.
  2. Suggestion: add a function to even hide the two buttons for a even more simple layout...
  3. Suggestion: allow to theme the progress bar

For 2 and 3 I use currently some solution via reflection (just to show you what I would suggest to be available without reflection):

fensterSimpleVideoController.post(new Runnable()
{
    @Override
    public void run()
    {
        try
        {
            Class<?> c = fensterSimpleVideoController.getClass();
            Field mProgress = c.getDeclaredField("mProgress");
            mProgress.setAccessible(true);
            SeekBar seekbar = (SeekBar) mProgress.get(fensterSimpleVideoController);
            ThemeManager.get().themeSeekbar(seekbar);

            Field mNextButton = c.getDeclaredField("mNextButton");
            Field mPrevButton = c.getDeclaredField("mPrevButton");
            mNextButton.setAccessible(true);
            mPrevButton.setAccessible(true);

            ((View) mNextButton.get(fensterSimpleVideoController)).setVisibility(View.GONE);
            ((View) mPrevButton.get(fensterSimpleVideoController)).setVisibility(View.GONE);
        }
        catch (IllegalAccessException e)
        {

        } catch (NoSuchFieldException e)
        {

        }
    }
});

Add support for ScaledType

Add support for scaledType attribute to expand, crop ... the video.
For example, to play videos with different resolution than the VideoTextureview without the black bars

FensterPlayerController interface extension suggestion

I think, the isShowing function should be part of this interface...

I want to use the simple and the default controller in common code and there I use the isShowing function, that's why I would need that...

Currently I have to work with casts and instanceof...

Overwrite error listener

Hi

I am trying to overwrite error listener but I have problem doing that.

If I understand correctly

textureView.setOnErrorListener(new MediaPlayer.OnErrorListener() {

...

return true });

should suppress

handleError(frameworkError) call in mErrorListener object.

unfortunately it is not happening and I am getting popup with "Impossible to play this video" - R.string.play_error_message.

Am I doing sth wrong?

thanks.

w.

Taking time to start a video

Hi,

I am using this library in my code and it is working good but it is taking time for video to start. I was checking at 4 MB/s connection, it was taking 6-7 seconds to start a video. Can you please confirm if there is a way to start a video little faster?

Remove your library ic_launcher icons

Hi,

Please remove ic_launcher.png icons from your library because it causes error on building when another library uses those icons on drawable folders. Or I think you can add those icons to mipmap folders. Thanks.

Can't use your library.

Hi, I think your library is a very useful library for me.
but when i want to use it, android studio says:

Error:(52, 13) Failed to resolve: com.github.malmstein:fenster:v.0.0.2

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.