UICollectionView embed youtube video still plays in another view - view

I have a video playing in a UICollectionView cell, basically a UIWebView embed with a youtube link. When i click on another cell which goes to another view, the video is still playing in the background. Since I have so many cells, its really hard to keep track of the video playing. Also when you tap a cell with a UIWebVIew (embed youtube video) it doesn't really detect the didSelectItemAtIndexPath.
Any suggestions would be helpful thanks!

Two thoughts.
Checkout NSNotificationCenter, you can maybe create an event when you press play and then watch for it.
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/Reference/Reference.html
Another option is to not play the video in the collection view, but rather segue to another view that plays the video. I'm not sure if this is too different from the functionality you want, but it seems simpler.

Related

Adobe Animate CC - Clicks not working with a Video embedded

I'm working on HTML5 canvas in Adobe Animate CC. Before embedding video I've created click actions and added links and since the video has been added (by Components > Video) all clickable objets stoped to work. Video is playing and slides and all animation is happening except interactive elements. I am feeling that the video is somehow embedded above everything (I have video layer at the very bottom).
Would you be able to help me please? Any advice appreciated
Video isn't part of the canvas, it's DOM element and it's over HTML5 canvas by default. If you'll view Animate's generated HTML code you can see it (video tag in "dom_overlay_container" div).
You need to rearrange your project and keep in mind that you have other DOM elements too in addition to the canvas.

JavaFX animations are flickering

I have a window displaying a video stream with a twitter feed as an overlay.
When a new tweet is displayed, the current tweet animates out using a rotate animation and the next tweet is rotated into view. The animations are performed using a RotateTransition.
The app also switches between different cameras to display different streams. To give an indication of when the app switches to the next camera, I have a progressbar that fills using a Timeline object.
This works well, until I resize the window. The rotate animations start to flicker, along with the progressbars as they gradually fill.
As a test, I disabled the video stream, to see what's happening. The 'artifact' doesn't occur then and I can resize as much as I want. If I play the stream and don't resize, everything works well.
The video player is based on VLCJ, but the actual pixels are drawn on a WritableImage in an Imageview.
See the following images that illustrate the problem.
At the bottom right you can see 2 different progress bars (a ProgresBar and a ProgressIndicator).
A part of the flickering result is still visible below the second image. It somehow stays visible, probably because the area doesn't get redrawn.
Any idea what makes the flickering happen? Is there anything I can do to fix or avoid this?
I tried some VM options in IntelliJ: -Dsun.java2d.d3d=true -Dprism.forceGPU=true to somehow enable hardware acceleration, but that doesn't seem to help.
Disabling the progressbar fill animation doesn't help either.
I had a similar problem with some arcs and shapes that would flicker when its attributes / sizes were changed.
The solution to my problem was to make sure that the methods used to change the shapes were called from inside the JavaFX thread.
Platform.runLater(() -> {
arc.setStartAngle(30);
arc.setLength(45);
}

Marmalade: change screen orientation when video is playing

In my project (using the Marmalade SDK), I have fixed the screen orientation to portrait in the .icf file. When a user touches a button, a video plays (using s3e video). However, This video is also played in portrait mode (which is not conducive to viewing), and I want the screen to automatically rotate to landscape and have the video take up the entire screen when the button is pressed.
Any help would be greatly appreciated!
You may want to take a look at the s3eSurface API: http://api.madewithmarmalade.com/group__surfaceapigroup.html#ga70a312268193e75b29451da071c87ead
I guess something like s3eSurfaceSetInt (S3E_SURFACE_DEVICE_ORIENTATION_LOCK, S3E_SURFACE_LANDSCAPE) before playing your video and the same with S3E_SURFACE_PORTRAIT will do the trick :)

UI Like Youtube in Android (Tablet)

I've spent 2 hours looking for a solution. I need to make a design
like the Youtube UI (Tablet UI) where it shows a vertical scroll, but
in each row there are 4 videos (landscape view). I've tried to do
something similar, but i couldn't =(
Is there any place where i can get the source code of the youtube
application for Tablet? Or maybe some resource to solve this? :(
BTW, my try was designing UI with scrollView, LinearLayout and my_item.xml, i tried to inflate my_item.xml adding programmatically into the linearlayout (horizontal orientation), but it doesn't work in the way that i want. I need something like a linearlayout but with horizontal and vertical orientation at the same time (something like a div).
I was thinking to use a ListView and a custom adapter (with my_item.xml), but i'm not sure if this can be the best solution.
Thxs
You should create seperate resources for each layout.
For example if the user is in Portrait mode you would have the correct layout in.
layout-port: layout for portrait orientation
layout-land: layout for landscape orientation
Read more on providing alternative resources here
Also i would recommend to read more on Handling runtime changes
This will help you with recognizing when the user changes orientation. You could actually use this guide and when the user flips the devices orientation you could then change the layout. Keep in mind hard coding this can be dangerous though. I would recommend using the layout folders.
Good luck!
Finally i solve my problem.
It works with a linearLayout(vertical) and adding linearlayout(horizontal) for each row. And obviously managing my scrollview.
BTW, i still think android should have a layout like a "div".
Thxs all

Animation in blackberry with several Images

I want to display a number of images in the same position so that it looks like animation. these images should come one after other within microsecond at the moment when the screen loads
There is a very good example of what you want to do on the supports forum knowledge base article Display an animatedGif
See the progress animations section of the BlackBerry knowledgebase article "Implement advanced buttons, fields, and managers"
It has a working code sample for slicing up an image of concatenated frames, and displaying each one for a period of time to create a progress animation.

Resources