youtube api player not working on iOS? - ios

I'm using the YouTube API in my flex app to play videos and it works fine running on my computer and android, but I'm getting an issue when I try to use it on iOS, I just get a black screen!
Any ideas?

I was curious so did some research.
First, I searched for SWFLoader on iOS and this post came up. I'll quote:
You cannot load SWFS that run ActionScript on IOS
Then I realized from your comment you may be using the Loader class; so I googled Flash Loader on iOS and came across this. To quote:
In an iPhone application, you cannot use the Loader.load() method.
However, you cannot run any ActionScript code in SWF content loaded
with the Loader.load() method. However, you can use assets in the SWF
file (such as movie clips, images, fonts, and sounds in the library).
You can also use the Loader.load() method to load image files.
You may benefit from reading through the actual Adobe docs. Specifically this page which focuses on unsupported APIs. It is the last link where the above quote comes from.

It's true you cannot load and run a SWF and in this case the video is a stream so you there is no media to save. Youtube does have an alternative URL that points to an actual mp4 file which will play on iOS. You can use a VideoDisplay player and that URL to play the video.

Related

Get path of a PHAsset coming from CameraRoll iOS with react native

I'm building a video app uploader using react-native.
I encounter a problem with file management from cameraroll. I have video inside my camera roll that i want to either play in my app (using rn-video), or upload them.
I tried using react-native-image-crop-picker with Passtrough option that should not compress video, but i feel like it's copying the video from cameraroll of iOS to AppData. So for big video i'm stuck sometime a longtime on "Processing Asset ..." window (see post here).
Now my question is, using react-native-cameraroll, i can fetch directly information about local video, but what i get is a link like this : ph://EA9508C5-6B69-46EC-8980-832774283946/L0/00
Is there a way to transform this link into something like this : 'file:///sdcard/Movies/sintel.mp4' without copying the video entirely into my appData (to avoid long import)
Thanks in advance
After some research, i found that we can use a different path called assets-library in iOS :
assets-library://asset/asset.${'mov'}?id=${appleId}&ext=${'mov'}
If you use this path with appleId being the ph asset identificator (something that look like this : const appleId = 'EFA45A33-818E-4A67-A0D8-50991A9B89FB/L0/001' it will work perfectly.
It will work with react-native-fs //File system for RN for copy/paste video for example

Making an App with PhoneGap that operates without internet

I want to create a small App that just shows WebPage with link, video Playing and PDF Documents. The problem is that I expect the app to open Video, PDFs etc without accessing internet.
So, when I click on video, it should play even without internet.
Is it possible to do this in PhoneGap?
As long as they are in a format that the device can handle in the browser directly, you should be fine. A good way to think of PhoneGap is like an enhanced web browser.
You should be able to put the files into the resources, and PhoneGap should be able to access them completely fine. It essentially works by using the file:/// scheme, so you can probably try making something like you'd want to put on the iPad, and try it on your computer. If it doesn't work on there, it likely won't work on the iPad either.
In terms of video files, you'd probably want to use an .mp4, as these should be natively supported by the iOS WebView.
Now that being said, if you're trying to get your app in to the AppStore, you may want to look into the Apple User Interface guidelines. For example section 12.3 of the App Store Review Guidelines states that apps that are ... a collection of links, may be rejected.
You may also find the iOS Human Interface Guidelines helpful.

MP4 Videos on website embed with html5 does not play on iOS

So I have a couple of videos on my website that I shot using the iPhone 4 and then converted to mp4, webm and ogg, so that I can use them with html5. Thing is, the video does not play at all on the 4 iOS devices that I tested and neither on Chrome for Android.
The Chrome issue could be because some of the mp4 are actually m4v files, but still after encoding with handbrake a video to the iphone 4 presset and in mp4 format, it still does not play.
What happens, you ask? Well, it shows the play button crossed out with a diagonal bar, the debug console on Safari does not show any message untill I try to access the video directly. Then it says: QuickTime Movie could not be played.
What can I do? I have been trying to encode with ffmpeg, have tried a handful of different solutions, some even found here on stackoverlow, but to no avail. The videos do get shorter, both in display size and MBs, but nothing works to fix the issue at hand.
I've been trying to get this corrected for a couple of weeks now. Any help and/or suggestions are welcome.
Thank you.
By the way, all the videos are on a registred users section of the website, but I have one for debugin on the main page, so feel free to test.
https://sidnerwebsite.sytes.net
It seems the issue is caused by the iOS' need of an Intermediate Certificate trusted by the iOS to play videos through an SSL connection. After disabling the re-routing of the website to its ssl counterpart, the videos display correctly on iOS.

What is the best tech to create an iPad app that both records and plays local videos?

The key functionality of the app would be 1) recording short videos (typically 20-30 sec), 2) playing the videos 1-5 times right after shooting them (slow motion and pausing are a must) and 3) drawing over the videos, i.e. I'd need an additional data layer on top of the raw video.
I've been studying the HTML5 app platforms (PhoneGap, Titanium) because I'd like to minimize writing native iOS code, but it seems both recording and showing embedded video doesn't work on these platforms. The record-play-edit process is pretty simple, but it needs to be super-smooth and fast.
If you want to use JS / HTML5 and then generate the app with eg. Phonegap, then one option could be a custom Phonegap plugin built for "Media capture" and then use HTML5 in creating the app logic.
Objective-C Media Capture:
http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5
Example Phonegap plugin for Audio Capture:
https://github.com/purplecabbage/phonegap-plugins/tree/master/iPhone/AudioRecord
More info about Phonegap plugin creation for iOS can be found from Phonegap wiki...

YouTube video fails to load with iOS UIWebView

W're developing an iPad app (iOS 4.3.5) that uses UIWebView to load YouTube videos. About once in five times a YouTube video will fail to load and I only see the following blank screen with YouTube's logo:
Looking in the debug logs I can only see the following warnings:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.5 (8L1)/Symbols/System/Library/Internet Plug-Ins/QuickTime Plugin.webplugin/QuickTime Plugin (file not found).
warning: No copy of QuickTime Plugin.webplugin/QuickTime Plugin found locally, reading from memory on remote device. This may slow down the debug session.
I've read about this warning (https://stackoverflow.com/questions/7149593/warning-while-playing-a-video-link-in-my-app) and don't think it effects this problem.
Does anyone know how to fix this?
Try with video tag of HTML 5. I have done the same thing with video tag and its working perfect with my application.
Below is the sample code for the same...
<html><head><video controls=\"controls\"><source src=\"%#\" type=\"video/mp4\" height=\"%0.0f\" width=\"%0.0f\"/></video></body></html>
(Answering my own questions)
OK. I'm pretty sure I figured this out. Some videos don't have a mobile player. You can look at the JSON output here:
http://gdata.youtube.com/feeds/api/videos/TWfph3iNC-k?v=2&alt=jsonc
And here:
http://gdata.youtube.com/feeds/api/videos/cd4jvtAr8JM?v=2&alt=jsonc
Notice how the second video (cd4jvtAr8JM) doesn't have the mobile player link. I guess this means that YouTube hasn't encoded it yet for mobile. Or it's restricted for mobile. Regardless, these type of videos all won't play for me.

Resources