Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working #10

Closed
milewski opened this issue Mar 19, 2016 · 21 comments
Closed

Not working #10

milewski opened this issue Mar 19, 2016 · 21 comments

Comments

@milewski
Copy link

doesnt matter what i do the screen is all white, i only can hear the video but cant see it.

@bradmartin
Copy link
Collaborator

#8

See if that works, I haven't had time to add the Z order to the plugin to fix this. I also need to confirm with the team what changed since 1.5 when it was working.

@bradmartin
Copy link
Collaborator

Just updated the plugin on npm with the added code for Android to make it visible due to a layering issue with the views.

@MiroValchev
Copy link

@bradmartin there is one caveat though, Z order puts the video on top of everything! For example, if you want to have subtitles showing over the video it won't work. Due to the Z order, the video will appear on top of the label with subs no matter what you do :(

@Ivshti
Copy link
Contributor

Ivshti commented Mar 30, 2016

@bradmartin do you have an idea what the layering issue is exactly? is there another solution other than the ZOrderOnTop which would allow us to draw elements on top of the video?

@bradmartin
Copy link
Collaborator

@MiroValchev @Ivshti - I don't know the exact issue. It was not an issue with NativeScript 1.5, the time I developed the plugin. I've asked the team what possibly changed with the layouts/page to cause the issue and they said it was present with 1.5, which it must be a device/android api issue if that's the case because I developed and tested it fine with NS 1.5.

As for using setZOrderOnTop(true) - we could make it an optional setting and use it in your XML like so: android:zOrder="true/false" but then if it's false I'm worried it won't render. I'll ping someone on the team to see if they have any suggestions on the best way to handle this to avoid issues later on.

@bradmartin bradmartin reopened this Mar 30, 2016
@Ivshti
Copy link
Contributor

Ivshti commented Mar 30, 2016

@bradmartin well I think it's related to the version.

We all kept testing with the same emulators/images/conditions, only thing that changed was {N} version.

Can you point us to whomever you asked and maybe tag them in this thread?

It doesn't render if we don't use setZOrderOnTop. Again, same issue didn't exist in 1.5, and we were able to draw subtitles/other elements on top of that

@enchev
Copy link

enchev commented Mar 30, 2016

Hey @Ivshti,

Actually I've suggested to @MiroValchev and @bradmartin to use this setting based on this thread:
http://stackoverflow.com/questions/19650483/video-is-not-showing-on-videoview-but-i-can-hear-its-sound

We've tested locally with simple Placeholder and VideoView in 1.5 and the issue was present. Here is an example:

<Page>
  <Placeholder creatingView="creatingView" />
</Page>
exports.creatingView = function (args) {
   var v = new android.widget.VideoView(args.context);
   v.setVideoURI(android.net.Uri.parse("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"));
   // v.setZOrderOnTop(true);
   v.requestFocus();
   v.start();
   args.view = v;
}

@bradmartin
Copy link
Collaborator

1.5

video1dot5

1.6

video1dot6

I haven't went digging into the core modules to see if I can find anything yet, but something happened I'm certain now. Just need to find the cause. Hopefully nothing major and a better solution can be found than setZOrderOnTop(true) which prevents laying views on top of the player.

@enchev
Copy link

enchev commented Mar 31, 2016

Hey folks,

You are right! Please accept my excuses!

I've finally replicated the problem and we will do our best to find immediately what's going on and how to fix it.

@enchev
Copy link

enchev commented Mar 31, 2016

You can monitor this issue:
NativeScript/NativeScript#1874

@Ivshti
Copy link
Contributor

Ivshti commented Mar 31, 2016

@bradmartin thanks for confirming it
@enchev great to see that we have a thread for the issue! Let us know on developments or/and if we can do anything to assist

@enchev
Copy link

enchev commented Mar 31, 2016

I've just updated the issue in our repo with a possible workaround. Can you try it and let me know if this will work for you?

@Ivshti
Copy link
Contributor

Ivshti commented Mar 31, 2016

@enchev thanks for the idea, we'll try it and inform you very soon

@bathejasumeet
Copy link

@bradmartin
I just stumbled into this thread since I am working on a custom video player with controls, and I had accomplished it , which worked till nativescript 1.5.2 but broke in 1.6/1.7 with this same issue of video being invisible. With respect to all that you said, it is true, setZOrderOnTop/setZOrderMediaOverlay seem to place the video view's surface view above the window, but this prevents overlaying custom controls on the video view(play/pause and seek bars), which perfectly worked till 1.5. I am aware of in and outs of video view, if you need any help fixing it, I am game ( it would be fun to have a video app on nativescript 1.7, since it is launches faster on android)

@Ivshti
Copy link
Contributor

Ivshti commented Apr 1, 2016

@bathejasumeet we use a fork of nativescript-video for a production app, and we had the same case with 1.5 vs 1.6/1.7; we worked it around by reverting to 1.5, but after we complete our alpha release we will be also available to help for resolving the issue.

See this -> NativeScript/NativeScript#1874 for the progress

@bathejasumeet
Copy link

@bradmartin @Ivshti @enchev
Guys, just ran a couple of tests , these are my findings
adding the native android.widget.MediaController to the videoView in nativescript 1.7 does not seem to hide it, it overlays perfectly.

        nativeVideoView= new android.widget.VideoView(args.context);
        nativeVideoView.setZOrderMediaOverlay(true);
        nativeVideoView.setZOrderOnTop(true);
        var mediaController = new android.widget.MediaController(args.context);
        mediaController.setAnchorView(nativeVideoView);
        nativeVideoView.setMediaController(mediaController);

Can we reverse engineer this?

@bathejasumeet
Copy link

@enchev
as per android docs :

"The MediaController will create a default set of controls and put them in a window floating above your application. Specifically, the controls will float above the view specified with setAnchorView()"

, I think we should target for achieving this behavior in interim, I mean trying to make the view with controls float over the VideoView like MediaController does.

@bradmartin
Copy link
Collaborator

@bathejasumeet - I meant to build this plugin with that as an option, to put the controls on top of the VideoView. I think I just forgot about it after my test run before making the actual android side of the plugin :) If you want to submit a PR with an optional attribute to set the controls on top of the VideoView that would be great. I'll create an issue with this as something needing to be done so it's not lost.

I also need to add a full screen option, again, just something I didn't have time to fully implement and NS needed a video plugin for devs less familiar with native controls so I wanted to ship it once it was decently functional.

@MiroValchev
Copy link

@bradmartin I can confirm that this has been fixed in {N} 2.1. Still, you have to remove the hack:

this._android.setZOrderOnTop(true);

@bradmartin
Copy link
Collaborator

Thanks for confirming. I'll update the package.

On Tue, Jul 5, 2016, 7:19 AM Miro notifications@github.com wrote:

@bradmartin https://github.com/bradmartin I can confirm that this has
been fixed in {N} 2.1. Still, you have to remove the hack:

this._android.setZOrderOnTop(true);


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#10 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AFulhEH3gpWR8n1IVGocqk7WjJsPzDU4ks5qSkvZgaJpZM4H0YdO
.

@bradmartin
Copy link
Collaborator

Just published the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants