Vimeo Froogaloop events not firing on iOS - ios

I'm trying to append an element to the page when a Vimeo embed starts playing. The code I'm using is:
var iframe = $videoObj.find("iframe")[0],
player = $f(iframe);
function onPlayProgress(id) {
if(!$videoObj.find(".video-play-pause").length)
$videoObj.append(controlHTML);
}
player.addEvent('ready', function() {
player.addEvent('play', onPlayProgress);
});
The event fires fine on desktop browsers, but it doesn't seem to fire on iOS7. I've also tried the play/pause events, but these don't work either. The ready event seems to be the only one that fires.
Is there a workaround for making the events fire or are they simply unsupported by iOS?
UPDATE
It seems that setting a video ID and using it with the API is what was missing to make it work on iOS (although that's not required in Chrome/Safari on desktop).

Related

muteLocalVideoStream not muting the video in agora

Iam new to react native. Iam using agora rtc (3.1.3) for video calling in my app. It works perfectly. We have some actions like switching camera and muting video etc. For muting video iam using the below code
const toggleVideo = async () => {
let mute = vidMute;
console.log('Video toggle', mute);
await (engine.muteLocalVideoStream(!mute));
setVidMute(!mute)
}
Where engine is my RtcEngine created using my app id. Issue is muteLocalVideoStream has no effect on my video. Iam testing in iphone. Please help
The muteLocalVideoStream method only stops the transmission of the video stream to remote users, it does not stop the video stream capture i.e. the local user can still view their video normally.
If you want to stop the video on the local user's device as well you can use the enableLocalVideo method instead. You can edit the code on line 4 - await (engine.enableLocalVideo(!mute));
I tried out your code on v3.1.6 of react-native-agora and everything works as expected.

Cordova: Hybrid iOS App Pause event doesn't get fired when making a phone call

Does the iOS app go to the background when we make the call using tel://123456789 ?
I have an iOS app that requires to log any outbound event happening through our app (like sending mail, calling, etc).
For Calling
we use some thing like :
in this case dialler opens up and makes the call but pause or resume events never gets
triggered . So basically we dont have hook/event after the call was ended to make the log
entry for call .
Though while replicating the same flow on android proper events(resume, pause) gets fired.
For Mail
we use some thing like :
in this case mail client of the user gets opened and our hybrid app goes to background and once mail is sent and the user returns to the app "resume" event gets fired
We need something similar for the phone call. Any pointers will be really appreciated.
You could try to listen to the click on the a tag then trigger that event yourself if it is not triggered by Cordova, that way you don't have to change your code. Using jQuery:
$('your_a_tag').on('touchstart', function(event){
$(document).trigger('pause');
});
Alternatively, you could open a support ticket on cordova-ios repo.

Background timer for react-native ios

I need to restrict one my functionality with a timer. So I am using react-native-background-timer plugin for that. In case of android, its working fine and I am getting my expected output. But in case of IOS it working only when app is in foreground, when I press home button after 4-5 seconds this plugin timer also gets paused. I have followed all instructions mentioned in this plugin. Still no luck.
Here is my code:-
BackgroundTimer.start();
setInterval(() => {
// Here I am writing my business logic
//Which works properly in case of foreground.
}, 1000)
I am also added comment here to get implementation help.
Please let me know. Is I am doing anything wrong?
Also suggest any alternatives for my functionality.
You mentioned plugin is wroking fine, because it's using dispatchAsync method which is basically using in IOS to do small background work.
Check Usage Crossplatform section.
BackgroundTimer.runBackgroundTimer(() => {
console.log("Background Timer");
//Check above log will appear after every 3 seconds.
//Your timer reducing and updating code goes here
},
3000);
//Don't forget to remove Timer
//rest of code will be performing for iOS on background too
BackgroundTimer.stopBackgroundTimer();

Cordova-plugin-facebook-4: logEvent method not working on iOS

I currently have an ionic app, which uses the following plugin: https://github.com/jeduan/cordova-plugin-facebook4 so that users can login to my app using the Facebook SDK, and so that I can track certain custom events, using the logEvent method.
Since it is an ionic app, I have a iOS and an Android build of the app. The custom events are working as expected on the Android platform. The strange thing is that in iOS, when an event is fired, I can clearly see the success event handler being called, indicating success, however, going to the Facebook analytics, I can clearly see that no custom event data is being saved. It tracks the usual app opens etc, it's just that custom events don't seem to be getting recorded for iOS.
Just to be clear any of this logging happens after the user has already logged in, I have heard it only works for iOS if you are authenticated with FB first.
So I have a generic function first:
$scope.fbLogEvent = function(eventName, params, valueToSum) {
if (valueToSum == null) {
valueToSum = 1;
}
if (!ionic.Platform.is('browser')) {
return facebookConnectPlugin.logEvent(eventName, params, valueToSum, function(success) {
return console.info('FB', eventName, 'event has been logged');
}, function(error) {
return console.error(error);
});
}
};
I then call the following function to do the actual tracking
$scope.fbLogEvent('item-requested', { item: $scope.item });
It works perfectly on Android
When I add an item on iOS (using Safari developer logging on the app running on my phone), I can see that the success function is called, because it logs the following message: FB item-requested event has been logged.
I have tested this with the latest version of the plugin (just to be sure), but that did not seem to make a difference.
UPDATE 3/3/2017 - for what it's worth, it does seem to pickup these events if they predefined events, as opposed to custom events.

Generating Remote Control Events from my app

I have two questions regarding Remote Control Events on iOS:
I know that music applications are registered to remote control events and then can receive such events from the iPhone's player widget.
Let's say I want my app to fire such events, is that possible?
How does headphones for example generate those events?
Without private API, you cannot send remotecontrol event to your application.
The reason is we cannot create such an Event (UIEvent) to send out by using:
[[UIApplication sharedApplication] sendEvent:anEvent];
You can, however save a registered event then play back by calling the above-function.
I don't know if it possible for headphone events but with private API, you can send some events like: home button press, power button press or mouse events (not tested).
You should read this book:
http://www.amazon.com/gp/product/1118057651/ref=pd_lpo_sbs_dp_ss_1?pf_rd_p=1535523702&pf_rd_s=lpo-top-stripe-1&pf_rd_t=201&pf_rd_i=0321278542&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=0T2AMHJCEEKJN41YJHD5
It'll be a hard work to make this works.
Take a look at GSEvent to know how to send an event to OS (iOS).
Edit: I've found 2 event types in GSEvent.GSEventType:
kGSEventHeadsetButtonDown = 1018,
kGSEventHeadsetButtonUp = 1019,
PS: - this use private API so it will be rejected if you post this app to AppStore.

Resources