[TIMOB-25566] iOS: VideoPlayer showsControls false does if url is set after creation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-23T09:11:47.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | iOS |
Labels | api, ios, showscontrols, videoplayer |
Reporter | Emmanuel Francis |
Assignee | Hans Knöchel |
Created | 2017-11-28T10:10:34.000+0000 |
Updated | 2018-06-25T20:28:47.000+0000 |
Description
I have below code block to show videoplayer in full screen with showscontrol false.
But this shows a pause control, please check the attached screenshot.
Attachments
File | Date | Size |
---|---|---|
Simulator Screen Shot - iPhone 6 - 2017-11-28 at 15.37.07.png | 2017-11-28T10:09:58.000+0000 | 736862 |
Hello, I can verify the issue in SDK 6.3.0.GA. Video player clontrols still show despite setting "showsControls: false" in video player. Thanks.
Same with 7.0.0.GA. Because of that the "Click" event is not firing. And since
mediaControlStyle:Titanium.Media.VIDEO_CONTROL_NONE
got removed in 7 it is not possible to hide the controls in 7In case anyone was going to try, it is still an issue with 7.0.2.v20180105084516. Sorry, I don't have the skills to fix this. I think it will be pretty important for many. As the documentation suggests, it can be used for splash screen videos I would think a lot of people do this. I am loading an explainer video and the play controls obscure the subtitles (for those with audio turned off). Watching this ticket with hope! :)
Any updates or ETA for this bug? This is a critical bug for us, we have an interactive event app going live early February that video playback is a massive part of, and we need to be able to hide the controls permanently. Can you escalate the priority of this bug with engineering please?
Works fine here:
In addition, some comments here are about iOS and some Android, so not sure where this is actually belonging to as the initial ticket includes the
ios
label which the above test-case is tested with.Definitely still showing controls on 7.0.1.GA on iOS for me using your test case above: https://vimeo.com/252241158/5892f123f6 Not tried on Android yet.
Everyone, The VideoPlayer "showsControls" property is new and was added to Titanium in 7.0.0 and is currently only supported on iOS. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer-property-showsControls If you're building with a Titanium version older than 7.0.0... or if you're building for Android, then you need to use the VideoPlayer "mediaControlStyles" property instead. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer-property-mediaControlStyle We'll look into adding "showsControls" support for Android in the near future.
@Joshua Quick, what about my above test case / demo video that show it doesn't work on iOS on 7.0.1.GA?
[~jfinnigan], perhaps we're missing "showsControls" support in Alloy/XML. I'll have someone double check.
Thanks, but that video is Hans exact test case running on 7.0.1.GA, not using Alloy/XML. Strange!
Hmm... I just tried the following code on iOS 11.2 and iOS 10.3.1 (via Xcode's iPhone simulator) and the "showsControls" property is working correctly for me. I built it with Titainum 7.0.1.GA.
[~jfinnigan], did you test on an actual iOS device or via the iOS simulator? Would you also mind showing us your "tiapp.xml" please? Thanks.
Real device, iPhone X running iOS 11.2.2. tiapp.xml:
I just tested it via iPhone X (iOS 11.2) simulator and this feature works for me. I'll see about getting someone here to test it on a real iPhone X device.
I ran both [~jquick]'s and [~hknoechel]'s above examples using the below environment and did not see any video player controls, even when tapping on the video: Real iPhone X with iOS 11.2.2 MacOS 10.13.3 Ti SDK 7.0.1.GA Appc NPM 4.2.11 Appc CLI 7.0.1 Xcode 9.2 (9C40b) I have been trying different settings and changing environment components, but have not been able to have the controls shown
*Re. Android compatibility.* Regarding this not being an issue on Android if you use mediaControlStyle. I note, the documentation might be causing some confusion here. If you access the documentation page with the link you provided (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer-property-mediaControlStyle) then you see the
mediaControlStyle
details. If you access it through the navigation the URL is http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer andmediaControlStyle
is not shown presumably because it has been removed. *Re. Replicating the issue.* I think I managed to replicate the issue consistently! Here is my index.xml:Here is my index.js
When I start the app, the top video shows the controls. The bottom one does not. It would seem that if you set the URL for the video it shows the play controls.
Okay. I'm able to reproduce this issue on iOS now. This issue happens if you set the video "url" property after setting the "showsControls" property like this...
*Work-Around:* You can work-around this bug by setting the "showsControls" property to false (even if it was already set to false before) after setting the URL property like this...
So, order matters. Anytime you set the "url" property, you'll need to set the "showsControls" property again because internally the native view's equivalent setting gets reset. (That's the bug we need to fix.)
Work around isn't working for me, still seeing the controls with this:
Working on this now. May be pushed forwards to a 7.0.3 if we do one.
Ok, so it seems like Apple restricts the property usage here. Regarding [the docs](https://developer.apple.com/documentation/avkit/avplayerviewcontroller/1615824-showsplaybackcontrols?language=objc), the property cannot be changed after the video has been rendered the first time:
So we either need to destroy the player and recreate it once a URL is changed (not really ideal) or state it as a known native limitation. I need to play with it a bit more. Due to the very soon 7.1.0 release, I'll move it out to 7.2.0 for now, as there is also a workaround by simply setting the URL on creation or creating a new video player once the URL changes.
PR: https://github.com/appcelerator/titanium_mobile/pull/9852 Test-Case:
Couldn't get it working copying the contents of TiMediaVideoPlayerProxy.m from the PR to my local SDK folder. Any other ideas to work this around without a SDK bump? In fact, my problem is a little different. I jus't can't remove the controls from video on iOS.
[~perdona] Whats your test-case? Does the above one from me works? The fix feels pretty save, so I am wondering if your test case may differ. [~jfinnigan] Can you also try it out please?
@Hans
When I set main thread to false, controls show up on video.
Thanks [~perdona], great feedback! I have updated the pull request to work on the legacy kroll thread as well.
*Closing ticket.* fix can be seen in SDK Version:
7.3.0.v20180618182516
*FR (Passed) Test Steps:*Created an application with the code above
Ran the program
Video played without any controls
*Test Environment*