Fire object's method in titanium List view - ios

Hi guys i am currently developing for IOS 7 with Titanium SDK 3.2.1.GA and i am in need of help.
I can't find anything on how to call an object's method within a list view
Basically i have a list view with a video player in each cell and a play button on top of it, i want the video player to start playing once the user clicks the play button, but i don't know how to fire the video player's play() method from within the list view.
Thank you for your help in advance

If you posted your code it would be easier to help you, but heres the general idea. Just listen on the itemClick event, then fire the play button for that ListItem:
// Keep an array of video players or something like that
var vidPlayersRefs = [...,...,...];
listView.addEventListener('itemclick', function(e){
// Get the video player for that row
var videoPlayer = vidPlayersRefs[e.itemIndex];
videoPlayer.open();
});

Related

How do I keep my video player working in flutter?

When I use the video_player plugin, I use the Navigator.push function to go to another screen where I push a button to display the video. Once the video is over, I push the back button. If I activate the Navigator.push function again and push the button to display the video, no visual is shown and only the audio is played. Can someone tell me what is going on and how to fix this?
Never mind, I found out that the issue was that I needed to call setState before I could display the video the second time.

How to pause JW Player on Ipad without controls

JW player, if you hide the control bar you can click the video to play and pause, this works fine in desktop.
When I tested this in ipad it plays but touching it again doesn't pause the video.
Verify with this URL, https://support.jwplayer.com/customer/portal/articles/1406723-basic-video-embed
**Dont use the control bar as I need it disabled.
If you hide the JW controls, then the player should also not react to clicking on the video as a means to start/stop unless you specifically add code to tell it to.
For this to happen you need to attach a function to the onDisplayClick event listener as follows:
**JW6 version**
jwplayer().onDisplayClick(function(){
jwplayer().play();
});
**JW7 version**
jwplayer().on('displayClick',function(){
jwplayer().play();
});
Just calling the play() method in this way will handle the toggle of play/pause states - you don't need to manage this yourself.
I tried to do it in proper way but that doesn't seem to work alright, this is the only solution works for me,
$('.video-wrapper').on({ 'touchend' :
function(){
if(dtjwplayer.getState() !== 'paused') {
dtjwplayer.pause(true);
}
}
});
This is a very basic requirement where people wants to disable the control bar, Please let me know if there is any better way to do it.

How to play a video in uiview Xcode obj C

I Need to play a video when the view load but, other code i have try to do the video player comes up. I want to play the video in the UIVIEW. Can someone please help!
You will need to use an AVPlayer, specifying an AVPlayerItem. This should allow you to use multiple AV items within a single view.
Basically, everything is explained here:
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html

How to hide only Next and Previous button in AVPlayer?

Is there any way to hide only Next and Previous buttons in AVPlayer while playing a video
You can only either hide them all or show them all via the AVPlayerViewController showsPlaybackControls property, so what I would recommend doing is using an open source or third party library or framework that controls AVPlayer for you.
Such as what's suggested by this related question, which ultimately points to this GitHub project. You can then remove or hide the controls you don't want to be visible.
Alternatively, you could create your own controls that call into, and control, AVPlayer.
=> you can get notification when ply or pause and stop
when you got notification of play at that time you can hide both next and preivios button

Web View - Playback requires user action - Swift

Web View - Playback Requires User Action - in Swift
Hi there.
In my Main Storyboard I have a Web View, that is triggered by a button.
When the button is pressed, it pops up a music video from Youtube. When I then press the “Play-button” in this Youtube view, the song is played, meaning I have visuals and audio :-)
Under the Web View Options, there is a checkbox called "Playback Requires User Action”.In the help explanation it says:
“mediaPlaybackRequiresUserAction
Property
A Boolean value that determines whether HTML5 videos can play automatically or require the user to start playing them.
Declaration
SWIFT
var mediaPlaybackRequiresUserAction: Bool
Discussion
The default value on both iPad and iPhone is YES. To make media play automatically when loaded, set this property to NO and ensure the or element you want to play has the autoplay attribute set.”
What does "autoplay attribute set” mean ?
I want this music video played, without pressing the “Play-button” in the Youtube view ? Is this even possible ?
Have searched, but found nothing.
I'm a novice and can’t figure out, how to do this.
Does anyone have a clue ? :-)
It would be highly appreciated.
Ola

Resources