Blackberry: Video player with labels and button - blackberry

I want to create a Screen in my app where there will be a video playing on the screen and there will be buttons and labels on the video screen like below.
How to implement that? Can you give some sample code or idea? Is it possible to implement multiple layers in one screen?

This is not possible on pre OS7.0 devices. For OS7.0 devices you can use ComponentCanvas class.
Check this info from RIM
Layering UI elements
You can place UI components on top of other UI components using the
ComponentCanvas class. Unlike AbsoluteFieldManager, which provides
similar functionality, a ComponentCanvas is drawn on top of other
fields and managers on a screen, like a video or camera field. You can
add standard UI components, such as labels, buttons, and drop-down
lists, to ComponentCanvas. For example, you can use a ComponentCanvas
to display a series of buttons on top of a video field or camera
field.
ComponentCanvas is found in the net.rim.device.api.ui.container
package.

Related

SwiftUI: Accessibility sound feedback for a draggable element

I am making an application that works essentially like a simple Drag-and-Drop Playground with the command blocks on the left and a droppable area on the right. I want to make it fully compatible with VoiceOver and I'm running into trouble with some of the accessibility aspects since this is my first Swift application.
This is what the playground currently looks like: (App Screenshot)
My goal is to provide the users with audio cues/feedback while they are dragging the elements to help them figure out what part of the screen they are currently at. The ideal functionality would be exactly like what one uses when editing an iOS device's Home screen (the arrangement layout of the apps).
When trying to rearrange apps on the home screen with VoiceOver enabled, you hear a row/column alert when you are dragging an app over an open area. I want a similar type of feedback that says "Droppable Area" when you are over the correct area (see scenario 1).
When trying to rearrange apps on the home screen with VoiceOver enabled, you hear a sound when you tap on an area that has no app icon. (This also happens when you are not editing the layout and simply tap on an open area with no app.) I want that noise to be what you hear when you drag a command over an area that is not droppable (see scenario 2).
Any ideas on how this might be possible or good references to look at?

Dumb Question: How do I make AVPlayer look like everyone else's?

My Current Setup (Subject to Change)
I have a simple iOS app right now that plays an M3U8 using AVPlayer. In order to place custom UI elements on top of the player (text alerts, mostly) I jimmy-rigged what is probably a terrible architecture, and I'm open to the idea of scrapping the whole thing and starting over.
First I created a new UIView which I called "MyPlayer". This UIView has a XIB file with nothing in it
Next I created a new NSObject (now UIView) which I called "PlayerDisplay". This class also has a XIB file associated with it, which contains an ImageView and a Label
In MyPlayer.m's init method, I instantiate a PlayerDisplay using an initWithMyPlayer method
In PlayerDisplay.m's initWithMyPlayer method, I created an AVPlayerViewController instance
I called [myPlayer addSubview:controller.view] and controller.view.frame = myPlayer.bounds to get the player to display within my view
I called [[NSBundle bundleForClass:[self class]] loadNibNamed:#"PlayerDisplay" owner:self options:nil] to load the XIB with the ImageView and Label
I called [myPlayer addSubview:self.contentView] and self.contentView.frame = myPlayer.bounds to get the player to display my ImageView and Label over top of the player
It felt hack-y at the time, and it feels hack-y now. But it allows me to insert a single MyPlayer view into an app and have it load all of my custom control and display logic. And it works (at least as far back as iOS 8, which is the oldest I've tested, and as far forward as iOS 12.4, which is the newest I've tested)
However I recently wanted to look into creating custom controls and looked to some industry leaders for inspiration (Netflix, YouTube, etc) - and I noticed that every other video player on the market looks the same, but none of them look like mine.
Netflix
ESPN
Hulu
Amazon Prime
YouTube
Twitch
Every one of these players has:
White icons with transparent backgrounds placed directly on top of the video (no control bar background)
A play/pause button in the dead center of the video
Seek back/forward buttons on either side of the play button
A seek bar at the bottom of the video
A single icon in the top-left
A horizontal list of icons in the top-right
Not only that, but Netflix and ESPN use the exact same icon set seek icons (although upon further inspection, the play buttons and cast buttons differ slightly)
Similarly, Hulu and Amazon Prime use the exact same icon set It was pointed out that Hulu and Amazon Prime differ sufficiently to be different icon sets. I still stand by Netflix and ESPN having identical seek buttons, though. I've rearranged the pictures to make this more obvious
It's too unbelievable to me that every single company disabled the default controls, built their own user interface from scratch, and they all just so happened to look identical. I feel like either AVPlayer has an option to enable this layout, Apple provides a framework for building UIs from icon sets which lays things out in this manner, or there may be a third-party library that is considered the "de facto" standard for video streaming, much like ExoPlayer is the leading name on Android
Compare and contrast all of the above players with my player, which is using Apple's default UI for an AVPlayerViewController:
The control bar has a background color and rounded corners
The play button is within the control bar
There are no seek forward / back buttons
There's only a volume control in the top right instead of a list of icons
How do I make my player look like theirs?
Is there just a flag in AVPlayer to say "use the other UI"? Is there a third-party library I should be using? What am I doing differently from all of the big names?
Note: I did discover AVPlayerViewControlsStyle, which I should theoretically be able to utilize with avPlayerView.controlsStyle = ..., however as you can tell from my setup above - I don't actually have an instance of AVPlayerView. Just my own custom view and the AVPlayerViewController. I tried typing controller.view.controlsStyle into Xcode to see if it would auto-complete, but it did not - making me think I don't have an AVPlayerView at all
Second Note: I also saw AVPlayerLayer when looking through the official Apple docs. What is that used for? Should I be utilizing it?

iOS iPad are there hover like workaround within apps? NOT websites

There seems to be dozens of questions on how to deal with :hover event on the websites when viewed in iPad.
My question is different - I'm building a native iOS game and it would be really good if a user can compare two items side by side. On PC this can easily be done by displaying one item a mouse-over panel when mouse hovers over an inventory item. The main benefit of such panel is that it is easy to show and easy to close on PC.
What are my alternatives for displaying a transient, hover-like interaction panel in a native iOS app?
For iPad (not iPhone) a UIPopover is pretty close to what you want. If you want to support iPhone/iPod as well, there are third party popover libraries for those devices.
However, I'm not sure how this would do for comparing 2 items, since the system only displays 1 popover at a time.
This is really more like a map callout bubble. You could build your own callout bubble sort of interface yourself without a lot of work. When you tap on an item, it would display it's callout, and when you tap on it again, or tap outside all items/callouts, it would hide it. I've done something like that for a custom map system I built for a client and it wasn't that hard.

Make a Page Control like the iOS 7 Camera app

I was curious as to how you would make the custom page control that Apple has implemented in their camera app, with the text essentially acting as the page control and moving along with the swipe.
Are they using a UI Element that has the text fade into the background like that?
If you mean the text on the bottom ("Video", "Photo", "Square", ...) there's no stock component for doing it.
If I had to implement it I'd try with a UICollectionView with a flow Layout. You can easily play with alphas and 3D transforms to achieve the same effect.
As a reference you may want to look at the WWDC 2012 talks about UICollectionView, in one of which (can't remember which one) they explain how to build a cover flow interface with using a flow layout.

iOS OpenTok - How to style the video views?

I am using the OpenTok iOS Framework to allow video chat within my app.
However, I am trying to find a way to custom style the views that display the user and connected user's streams.
From what I have found, it seems like these views are created in OTVideoView files, but I can only access the header.
Can anyone point me in the right direction on how to customize the views for the streams so I can make it look nicer than the default styling?
Hi, Each Subscriber.view of publisher.view is really a UIView object (Technical talk: OTVideoView is subclass of UIView). You can style them however you like by applying transforms and such to the view.
For example, to adjust width/height dynamically, you can do something like this:
[_publisher.view setFrame:CGRectMake(left, top, width, height)];
Anything you can do to UIView, you can do with OTVideoView.
Here's UIView's documentation: http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html
Hope that helps,
Song
P.S. If you have time, check out this blog post about using Core Graphics with OpenTok's video streams to do some nifty image recognition!
http://www.tokbox.com/blog/fun-with-core-graphics-in-ios/

Resources