Coder Social home page Coder Social logo

android-player-samples's People

Contributors

alejandrolagosr avatar bhnath avatar brwhyan avatar doktorj7 avatar firekesti avatar jaredrummler avatar jessieamorris avatar jrw95 avatar keamcrf avatar nandovelazquez avatar pajato1 avatar pajatopmr avatar raajbcove avatar sahlas avatar sergiomartinez4 avatar vojeda-bc 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-player-samples's Issues

Brightcove maven repo seriously slowing down gradle sync

I have found in the past week or 2 that my gradle syncs have been seriously slowed down, yesterday I had time to dive in and have a look as to why. I discovered that gradle spent most of its time scanning your repo, http://repo.brightcove.com/releases

Fed up with waiting up to 2 minutes on each run of my app I decided to pull the repo and add the Brightcove SDK manually, however then I had trouble with that method. Initially I just added the Brightcove SDK and Exoplayer2 plugin, following the instructions on your site. But I discovered that then I have to seek out all of the dependencies that these libraries require such as Exoplayer itself and stuff like requery. Perhaps I'm doing it wrong, would be interested if there's an easy way to drop the AARs in to my project.

But the real issue is why is http://repo.brightcove.com/releases so slow? Including it is causing incremental builds to take up to 2 minutes instead of up to 2 seconds. I haven't had this issue with 4 other repos.

androidx: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.brightcove.player.util.LifecycleUtil.onActivityCreated(android.os.Bundle)' on a null object reference

Using the androidx appcompat dependency and BrightcovePlayerFragment, app crashes with the following NPE:

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.brightcove.player.util.LifecycleUtil.onActivityCreated(android.os.Bundle)' on a null object reference
at com.brightcove.player.appcompat.BrightcovePlayerFragment.onActivityCreated(BrightcovePlayerFragment.java:78)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2460)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1483)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:620)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
at android.app.Activity.performStart(Activity.java:7157)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2937)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)`

Example: https://github.com/mihaelaLo/BrightcoveErrorApplication

Gradle sync fails with samples

I have cloned and imported via VCS into Android Studio, however the gradle sync fails with this message.

Error:Unable to load class 'org.gradle.logging.ProgressLogger'.
Possible causes for this unexpected error include:

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I have attempted both options listed above, including a full system restart. Other projects sync ok.

Error: unable to find valid certification path to requested target

I am using some brightcove dependencies in my code:

repositories {
google()
maven {
url 'http://repo.brightcove.com/releases'
}
mavenCentral()
jcenter()
}

dependencies {
implementation "com.brightcove.player:android-sdk:6.16.4"
implementation "com.brightcove.player:exoplayer2:6.16.4"
}

Recently I started to migrate all libraries from jcenter to maven (this is required by Google), so now I have this in repositories section:

repositories {
google()
maven {
url 'https://repo.brightcove.com/releases'
}
mavenCentral()
}

As you can see, I also changed the brightcove url from http to https based on the documentation (https://sdks.support.brightcove.com/android/basics/step-step-simple-video-app-using-native-sdk-android.html#Create_a_project), but now I am getting an error:

Could not resolve com.brightcove.player:exoplayer2:6.16.4.
> Could not get resource 'https://repo.brightcove.com/releases/com/brightcove/player/exoplayer2/6.16.4/exoplayer2-6.16.4.pom'.
> Could not HEAD 'https://repo.brightcove.com/releases/com/brightcove/player/exoplayer2/6.16.4/exoplayer2-6.16.4.pom'.
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I've tried using the http instead on https as I used in the past, but I am still receiving another error:

Could not find com.google.android.exoplayer:exoplayer-core:2.10.8.
Required by:
project :sample > com.brightcove.player:exoplayer2:6.16.4

Is the library working only in combination with jcenter() and url 'http://repo.brightcove.com/releases' or is there something else that I need to do in order to make it working without jcenter()?

brightcove keep crashing because of NPE

Hi Everyone!
recently I keep getting this kind of error:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.exoplayer2.SimpleExoPlayer.getPlayWhenReady()' on a null object reference at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.reportPlayerState(Unknown Source) at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.access$500(Unknown Source) at com.brightcove.player.display.ExoPlayerVideoDisplayComponent$9.onLoadError(Unknown Source) at com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener$EventDispatcher$4.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:743) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:150) at android.app.ActivityThread.main(ActivityThread.java:5546) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

I am not sure why and I don't know how to handle or prevent this crash. I keep getting it recently especially when the error event called. It will be easier if inside the brightcove have null checking for this. Can someone help me ? Thanks!

Picture in picture mode is not playing properly

Hello,
since few days I hv been working in adding the PIP functionality to our application at work.
For the player I tried with BrightcoveExoPlayerVideoView as well as BrightcoveExoPlayerTextureVideoView
So far I had 2 issues with these two kind of player:

  1. Before entering to the PIP mode, the minimize button is not displayed on the player even so the responsible activity is being pip registered.

  2. When the player is on the pip mode, there's a play button which relaunch the audio of the previous played video content. At the end I got 2 videos playing at the same time(2 audio playing).

For information, I saw on the release note of the 10 Dec that there was fixes of concurrency issues on PIP mode so I tried with the last version of Brgihtcove player as well as the last version of ExpoPlayer. I'm still getting the same errors mentioned above.
thank you in advance.

Distorted Video on API 19

This is currently only happening on a Samsung Galaxy S4 on API 19.

The first chunk of video loaded is always distorted, and then later it "fixes" itself to show a valid video.

The same thing occurs when the app is navigated away from, and back to.

The only error that I see in the console that would relate to this is as follows:

E/ACodec: [OMX.qcom.video.decoder.avc] storeMetaDataInBuffers failed w/ err -2147483648

Video duration change, while changing video quality.

Hi,

For my case I'm need to calculated the watched percentage. So that I used baseVideoView.getDuration(); method to get total video duration. Its working fine, until I change my video quality while video playing.

When I try to change the video quality total video duration is changed. Changes in terms of Milli-seconds.

here is my log.
Log1:
Actual video Duration is : 1787000
10-18 11:26:32.304 5823-5823/com.test.videotest D/Khaleel: totalVideoDuration : 1787333-->watchedDuration : 1787-->watchedPercentage : 99.98137
10-18 11:26:49.409 5823-5823/com.test.videotest D/Khaleel: totalVideoDuration : 1787238-->watchedDuration : 10-->watchedPercentage : 0.55952257
10-18 11:27:06.552 5823-5823/com.test.videotest D/Khaleel: totalVideoDuration : 1787000-->watchedDuration : 10-->watchedPercentage : 0.5595971

Log2:
Actual video Duration is : 644000
10-18 11:27:51.323 5823-5823/com.test.videotest D/Khaleel: totalVideoDuration : 644000-->watchedDuration : 10-->watchedPercentage : 1.552795
10-18 11:27:54.507 5823-5823/com.test.videotest D/Khaleel: totalVideoDuration : 643703-->watchedDuration : 10-->watchedPercentage : 1.5535114
10-18 11:27:57.684 5823-5823/com.test.videotest D/Khaleel: totalVideoDuration : 643633-->watchedDuration : 10-->watchedPercentage : 1.5536804

What's wrong with my code. Please help me to sort this out.

Thanks.

Manifest Permissions

Why does com.brightcove.player:exoplayer adds

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

by default when they are actually not needed for video playbacks?

Playing local videos

how can we play a local mp4 file in android using brightcove exoplayer

i got a code snippets from https://support.brightcove.com/code-snippets-using-native-sdk-android

String PACKAGE_NAME = getApplicationContext().getPackageName();
Uri video = Uri.parse("android.asset://" + PACKAGE_NAME + "/" + R.video.getting_started);
brightcoveVideoView.add(Video.createVideo(video.toString()));
brightcoveVideoView.start();

but R.video cannot resolved

any other solutions please.

Getting Invalid Token ErrorCode: 210

Hey I am new to this, getting Error JSON: '{"error": "invalid token","code":210}' response when using readAPI.findVideoById(Long.parseLong(videoId),
videoFields, null);

Full Screen support for video views in recycler views

Possibly related to #148 - this is a very common use case so it would be nice to see this added. In the long run you may want to refactor your code to favour composition over inheritance so that your customers don't have to deal with issues such as this (inheriting from base Brightcove activity and fragment classes isn't always feasible).

EDIT: The fullscreen button is visible onscreen, but doing it merely hides the phone status bar.

Video stretched without the Internet

Hello!

I found an issue in Brightcove SDK. When I disable Internet connection and video will stop I change seek position to place without buffering and then click on the screen video will be stretched. I use "fullScreen()" method for portrait and landscape.

I use: Sample "AdRulesIMASampleApp" (ExoPlayer)

Steps for reproducing:

  1. Start to play any video (all it's ok, see screenshot_1)
  2. Turn off the Internet
  3. When buffering not available video will stop
  4. If click on the screen video will be stretched (see screenshot_2)

Layout:

 <com.brightcove.player.view.BrightcoveExoPlayerVideoView
        android:id="@+id/brightcove_video_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_horizontal|center_vertical" />

Can you fix it or any help, please?

screenshot_1
screenshot_2

Download Notification

As per docs:
For videos downloaded for offline playback, the download status can also be shown in the Notification Area. The notification title is set to the video title. The notification is removed if the download is paused or cancelled.

Is it possible to hide the notification even if the download is in progress?
If not possible, how to change the notification title and how to make a specific action when the notification is clicked?

Replay a Video?

i have a question about Brightcove SDK for Android

Can i replay a video when i clicked a rewind button?
i don't want a rewind button. can i custom the brightcove player?

let me know about this solution.
Thanks!

Stretch Video in <com.brightcove.player.view.BrightcoveExoPlayerVideoView /> to fit screen programmatically

I tried various ways to change the view via xml as below:

`<com.brightcove.player.view.BrightcoveExoPlayerVideoView
android:id="@+id/Player"

        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        app:resize_mode="fill"

        android:layout_alignParentTop="true"

        android:layout_alignParentBottom="true"

        android:layout_alignParentLeft="true"

        android:layout_alignParentRight="true"

        android:fitsSystemWindows="true"

        android:foregroundGravity="center"

        android:adjustViewBounds="true"

        android:scaleType="fitXY"

        android:layout_gravity="center_horizontal|top"

        tools:layout_editor_absoluteY="0dp"

        android:layout_marginTop="0dp"

        android:layout_marginBottom="0dp"

        android:layout_marginRight="0dp"

        android:layout_marginLeft="0dp"

        android:numColumns="auto_fit"

        android:stretchMode="columnWidth"

        />`

In order for the video inside it can fitXY, but it did not work.

is there any other way by adding to the program code in java?

Like :

brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.Player); brightcoveVideoView.setScaleType(ScaleType.FIT_XY);

is there any other simple way to do the above on Brightcove Video View so that the video inside to fit screen programmatically?

Not able to resume a video to download after a day

Hello BrightCove Team,
Below is what I'm trying to do:

Step 1: To download any video, I've first request a license to download a video, and on success calling the downloadVideo() by passing video information.

Step 2: Pause a downloading video then resume it on the same day, It starts downloading the video from the last position.

Step 3: But when I resume a video the next day then it is not resuming a video and simply it gives a 0 as a status. Below is the code snippet of the resume method.

Note: Can you please let me know why this behavior comes when trying to resume video the next day. Also do let me know what are other factors may responsible for resuming the video.

public void resumeVideoDownload(@NonNull
                                Video video,
                                @NonNull
                                OfflineCallback<java.lang.Integer> callback)
This method is used to asynchronously resume the download of a video which was previously paused.
Parameters:
video - the video to resume its download.
callback - Provides the result of the operation. In case the download of the requested video has been resumed successfully, OfflineCallback.onSuccess(Object) will be called to provide an Integer value of its current DownloadStatus.StatusCode. OfflineCallback.onFailure(Throwable) will be called in case there was an error. UnsupportedOperationException if the underlying download process does not support pausing video downloads.

play-services-ads is out of date

Dependency com.google.android.gms:play-services-ads as used in brightcove-exoplayer/AdRulesIMASampleApp uses version 11.0.4 and is several years out of date. Bumping to latest version 19.0.4 causes compilation to fail.

Brightcove seekbar on Android TV

Thanks for Brightcove Team.
I have use Brightcove Android SDK for my project on Android TV but when BrightcoveSeekBar was focused and dragged by DPAD then variable "dragging" in BrightcoveSeekBarController always is true. I hard tried set it to false but I can't.
Please help me. Many thanks!

[Question] Default initial bitrate

Technically i have two three questions:

It's not entirely clear to me, what is the actual license on Brightcove Player for Android? Is it Apache 2.0 as Exoplayer?

Main question:

With ExoPlayer, when i build the BandwithMeter i can set the "setInitialBitrateEstimate". What is the equivalent in BP? Right now Brightcove Player starts at the lowest bitrate (360p) and quickly switches up to 1080p. Setting the "setInitialBitrateEstimate", i could force ExoPlayer to start 720p+ and go up from there.

Update: i sort of looked around, and found DEFAULT_BIT_RATE inside DefaultSourceSelectionController, which is probably what i'm looking for, unfortunately i can't change that.
Also there is BrightcoveExoPlayerVideoView.getSourceController().findBestSourceByBitRate(), which is probably the method i need, but how can i set the found source as the startup source for the VideoView?
This is all i'm doing to start playing (urlstring is pointing to m3u8 link).

mVideo = Video.createVideo(urlstring, DeliveryType.HLS);
mPlayerView.add(mVideo);
mPlayerView.start();

Edit:
One more question, how can i activate the buffering indicator?

java.lang.UnsupportedOperationException: Unsupported Service: captioning

java.lang.UnsupportedOperationException: Unsupported Service: captioning
at com.android.layoutlib.bridge.android.BridgeContext.getSystemService(BridgeContext.java:602)
at com.brightcove.player.controller.BrightcoveClosedCaptioningController.initCaptioningManager(BrightcoveClosedCaptioningController.java:426)
at com.brightcove.player.controller.BrightcoveClosedCaptioningController.(BrightcoveClosedCaptioningController.java:115)
at com.brightcove.player.view.BaseVideoView.setEventEmitter(BaseVideoView.java:399)
at com.brightcove.player.view.BaseVideoView.finishInitialization(BaseVideoView.java:337)
at com.brightcove.player.view.BaseVideoView.onFinishInflate(BaseVideoView.java:326)
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.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$53(RenderTask.java:659)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

how can i fix this?

BrightcoveExoPlayerVideoView in layout XML breaks IDE preview

isInEditMode() should be used to skip code when the custom view is shown in the preview in Android Studio.

java.lang.NullPointerException
	at com.brightcove.player.analytics.Analytics.getDeviceType(Analytics.java:881)
	at com.brightcove.player.analytics.Analytics.<init>(Analytics.java:195)
	at com.brightcove.player.analytics.Analytics.<init>(Analytics.java:185)
	at com.brightcove.player.display.VideoDisplayComponent.<init>(VideoDisplayComponent.java:194)
	at com.brightcove.player.display.ExoPlayerVideoDisplayComponent.<init>(ExoPlayerVideoDisplayComponent.java:282)
	at com.brightcove.player.view.BrightcoveExoPlayerVideoView.createVideoDisplayComponent(BrightcoveExoPlayerVideoView.java:73)
	at com.brightcove.player.view.BaseVideoView.setEventEmitter(BaseVideoView.java:388)
	at com.brightcove.player.view.BaseVideoView.onFinishInflate(BaseVideoView.java:325)
	at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:876)
	at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
	at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
	at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
	at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
	at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
	at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
	at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
	at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:325)
	at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
	at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
	at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:547)
	at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:681)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Problem while Integrating Freewheel and Widevine at a time in Brightcove player.

I am integrating freewheel Ad and Widevine for video protection in brightcove player in Android App.

  • If I integrate Freewheel ad using demo 'BasicFreeWheelSampleApp' with normal video(non-widevine), then ad playing.
  • If I use Widevine protection on video using demo 'BasicWidevineSampleApp' without Ad, then it plays video smoothly.

** But, If I integrate Freewheel and Widevine in one player at a time, then nothing playing.

Please investigate issue and reply soon.

Can't get onDownloadCompleted in DownloadEventListener

Verson

I modified OfflinePlaybackSampleApp to test the download functionality, and version I used is:
com.brightcove.player:android-sdk:6.15.1

Problem

I'm using OfflineCatalog to download a video.
In the DownloadEventListener, it keeps getting onDownloadProgress but can't get onDownloadCompleted.

Attached log for reference:
log

The main methods I used are:

1)
Video video = VideoParser.buildVideoFromJSON(json, eventEmitter);

2)
catalog.requestRentalLicense(video,
                    Calendar.getInstance().getTime(),
                    2880,
                    new RequestLicenseListener());

3)
private class RequestLicenseListener implements EventListener {
    @Override
    public void processEvent(Event event) {
        final Video eventVideo = (Video) event.properties.get(Event.VIDEO);
        switch (event.getType()) {
            case EventType.ODRM_LICENSE_ACQUIRED:
                downloadVideo(eventVideo);
                break;
            default:
                break;
        }
    }
}

4)
private void downloadVideo(Video video) {
    catalog.addDownloadEventListener(new DownloadEventListener());
    catalog.downloadVideo(video, new OfflineCallback<DownloadStatus>() {
        @Override
        public void onSuccess(DownloadStatus downloadStatus) {
            Log.e(TAG, "downloadVideo onSuccess");
        }

        @Override
        public void onFailure(Throwable throwable) {
            Log.e(TAG, "downloadVideo onFailure: ", throwable);
        }
    });
}

5)
private class DownloadEventListener implements MediaDownloadable.DownloadEventListener {
    @Override
    public void onDownloadRequested(@NonNull Video video) {
        Log.d(TAG, "onDownloadRequested");
    }

    @Override
    public void onDownloadStarted(@NonNull Video video, long l, @NonNull Map<String, Serializable> map) {
        Log.d(TAG, "onDownloadStarted");
    }

    @Override
    public void onDownloadProgress(@NonNull Video video, @NonNull DownloadStatus downloadStatus) {
        Log.d(TAG, "onDownloadProgress" + downloadStatus.getProgress());
    }

    @Override
    public void onDownloadPaused(@NonNull Video video, @NonNull DownloadStatus downloadStatus) {
        Log.d(TAG, "onDownloadPaused");
    }

    @Override
    public void onDownloadCompleted(@NonNull Video video, @NonNull DownloadStatus downloadStatus) {
        Log.d(TAG, "onDownloadCompleted");
    }

    @Override
    public void onDownloadCanceled(@NonNull Video video) {
        Log.d(TAG, "onDownloadCanceled");
    }

    @Override
    public void onDownloadDeleted(@NonNull Video video) {
        Log.d(TAG, "onDownloadDeleted");
    }

    @Override
    public void onDownloadFailed(@NonNull Video video, @NonNull DownloadStatus downloadStatus) {
        Log.d(TAG, "onDownloadFailed: " + downloadStatus.toString());
    }
}

Change pause icon

How can I change the pause icon?

I would like to set different images for the play button.

When I set:

 <style name="BrightcoveControlBar.Custom">
        <item name="brightcove_play_image">@drawable/play_icon</item>
        <item name="brightcove_pause_image">@drawable/pause_icon</item>
    </style>

the button play/pause doesn't react

Failed resolution of: Lorg/jacoco/agent/rt/internal_8ff85ea/Offline;

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_8ff85ea/Offline;
at com.brightcove.player.appcompat.BrightcovePlayerFragment.$jacocoInit(BrightcovePlayerFragment.java)
at com.brightcove.player.appcompat.BrightcovePlayerFragment.(BrightcovePlayerFragment.java)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Display playlists

I am wondering if there is a way to display all the videos in a certain playlist on an android device. As it stands right now, I am able to load the first video in the playlist and continue to play through all of the videos. However, I wish the user to be able to select any video in the playlist without having to watch all the videos up to that point.

Any help would be great! Thanks

Render problem in Widevive protected videos after seek.

There is a problem in widevine protected videos that; When I seek to position by programatically or manually by seekbar, It looks like looping some sagment of video, and some times, it displays many thumbs types on top.
I am attaching links of probems :
Looping : https://dl.dropboxusercontent.com/u/81270960/big%20bang/VID-20140526-WA0006.mp4

Thumbs : https://dl.dropboxusercontent.com/u/81270960/big%20bang/Photo%202014-07-02%2018.22.31.jpg

Videos, that are not secured by widevine are running fine.

Sample Account, Policy and Video Id's wrong - onError callback not firing.

These values in the sample applications are not working. Pulling the values from the iOS sample applications worked though.. The demo values need updating in this project but it does indicate issues with error handling.

The onError callback was not being fired when calling catalog.findVideoByID with bad values. There is also not good enough error reporting in the android logs to indicate these errors. The onError callback should be firing with detailed information on a invalid policy, catalog, or videoId and this was not happening.

I noticed in the android log that it said video not found.. changed the value and still no callback.. then clicked the url that the player was trying to access "https://edge.api.brightcove.com/playback/v1/accounts/3636334163001/videos/3987127390001" and only in there saw that there was a INVALID_POLICY_KEY error.

Can you give an example of nested recyclerview

Hi,

Thank you for such a great library.

I have a requirements like instagram feed where a user can upload single or multiple media in a post. Single works fine by using your videoList example but suppose if I have a horizontal recyclerview or viewpager2 as a view item then how can we achieve proper stopping and playing of the video players?

app become laggy/heavy and then crashed when downloading

I've applied similar flow with the sample app for offline videos, but in my app, the app becomes very laggy and sometimes in some cases it crashed but I can't get the error log. what might be the reason for it and how can I improve this? Thanks!

Usage of Jcenter

hi guys, I tried using brightcove but removing jcenter() on my gradle since it's deprecated and it seems brightcove is requiring jcenter() to be imported as I'm having error if I do so. Am I correct that brightcove needs jcenter?

Do you have any plan to support MediaController?

Hello.

I'm building an app using brightcove.
However, I am trying to create a player by observing the app's degisn guide
I need a full screen button or something to get a callback.
I can not find it.

Can I help you?

And do you plan to consider interface compatibility with mediaController?

BasicIMASampleApp crash with release variant

When I run BasicIMASampleApp project as release variant it crashed with:

java.lang.NoSuchMethodError: No super method setOnCompletionListener(Landroid/media/MediaPlayer$b;)V in class Landroid/widget/VideoView; or its super classes (declaration of 'android.widget.VideoView' appears in /system/framework/framework.jar:classes2.dex)
at com.brightcove.a.b.(Unknown Source:21)
at com.brightcove.a.a.(Unknown Source:211)
at com.brightcove.a.a.(Unknown Source:6)
at com.brightcove.player.samples.ima.basic.MainActivity.a(Unknown Source:70)
at com.brightcove.player.samples.ima.basic.MainActivity.onCreate(Unknown Source:56)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Possible reason is due to wrong proguard settings. I facing same issue after update ima&brightcove sdk to latest

BrightcovePlayer

This class is missing please check this and resolve this issue ASAP sir.

Thank You

Jetpack compose ableness

Hi I would like to know if Brightcove sdk can be integrated with jetpack compose built application.

NotSerializableException: com.brightcove.player.captioning.PreviewThumbnailFormat

brightcoveVersion = "6.8.0" and 6.13.3

Issue is happening when you load the video in the activity
Log:

java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.brightcove.player.model.Video)
       at android.os.Parcel.writeSerializable(Parcel.java:1786)
       at com.brightcove.player.model.Video.writeToParcel(Video.java:1067)
       at android.os.Parcel.writeParcelable(Parcel.java:1755)
       at android.os.Parcel.writeValue(Parcel.java:1661)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:801)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1506)
       at android.os.Bundle.writeToParcel(Bundle.java:1181)
       at android.os.Parcel.writeBundle(Parcel.java:841)
       at android.content.Intent.writeToParcel(Intent.java:10199)
       at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4859)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1617)
       at android.app.Activity.startActivityForResult(Activity.java:4564)
       at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
       at android.app.Activity.startActivityForResult(Activity.java:4522)
       at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
       at android.app.Activity.startActivity(Activity.java:4883)
       at android.app.Activity.startActivity(Activity.java:4851)
   
       at android.view.View.performClick(View.java:6886)
       at android.view.View$PerformClick.run(View.java:26083)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6938)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
    Caused by: java.io.NotSerializableException: com.brightcove.player.captioning.PreviewThumbnailFormat
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1233)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
       at java.util.ArrayList.writeObject(ArrayList.java:762)
       at java.lang.reflect.Method.invoke(Native Method)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:977)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1545)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1481)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1227)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
       at java.util.HashMap.internalWriteEntries(HashMap.java:1789)
       at java.util.HashMap.writeObject(HashMap.java:1366)
       at java.lang.reflect.Method.invoke(Native Method)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:977)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1545)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1481)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1227)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1597)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1558)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1481)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1227)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
       at android.os.Parcel.writeSerializable(Parcel.java:1781)
       at com.brightcove.player.model.Video.writeToParcel(Video.java:1067) 
       at android.os.Parcel.writeParcelable(Parcel.java:1755) 
       at android.os.Parcel.writeValue(Parcel.java:1661) 
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:801) 
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1506) 
       at android.os.Bundle.writeToParcel(Bundle.java:1181) 
       at android.os.Parcel.writeBundle(Parcel.java:841) 
       at android.content.Intent.writeToParcel(Intent.java:10199) 
       at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4859) 
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1617) 
       at android.app.Activity.startActivityForResult(Activity.java:4564) 
       at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767) 
       at android.app.Activity.startActivityForResult(Activity.java:4522) 
       at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754) 
       at android.app.Activity.startActivity(Activity.java:4883) 
       at android.app.Activity.startActivity(Activity.java:4851) 
       at android.view.View.performClick(View.java:6886) 
       at android.view.View$PerformClick.run(View.java:26083) 
       at android.os.Handler.handleCallback(Handler.java:789) 
       at android.os.Handler.dispatchMessage(Handler.java:98) 
       at android.os.Looper.loop(Looper.java:164) 
       at android.app.ActivityThread.main(ActivityThread.java:6938) 
       at java.lang.reflect.Method.invoke(Native Method) 
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 

Video is stretch while playing video then changing to another video

@sergiomartinez4

My situation is:
My brightcove video view is match parent (which device screen size). When video is playing, then change to other video source with difference source size, so video screen is stretched to match parent size. After video is loaded, then surface view size match video size.

My question is:
How can I correctly make surface view not stretch like this, only reize when video is loaded?
I see there is event video size know and unknown. Can it be used or I need to manually layout or what way?

Thanks

pre roll is not localized for portuguese langyage

Hey i need to localize pre roll ad for all locales. with the help of setLanguage() method i made it localized except for Portuguese. For Portuguese i am passing "pt" as language code. But pre roll is coming as english. Please look in to this issue. If i am missing anything here, please suggest me.

I am using following lines
ImaSdkSettings settings = new ImaSdkSettings();
settings.setLanguage("pt");
googleIMAComponent = new GoogleIMAComponent(brightcoveVideoView, eventEmitter, true, settings);

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.