How do I have the same video on iOS and Android? - android

I have an app that was developed for iOS and Android (both are native). Both apps use the same api to download content such as images, documents, and videos. The video format is in mp4. Of course the videos play fine in iOS but some Android tablets have issues playing the videos reliably. Sometimes they play, sometimes (and usually) they don't.
Obviously this is a codec issue. I've suggested we have the user upload two videos, one for android and one for ios, but it doesn't seem to be an option at this point.
Is there a bitrate/fps setting that can be used to make video across both platforms more reliable?

Related

How does Playit app prevent videos from playing in other media players? What technology does it use

There is a website pdisk.net and whatever the video we upload from our computer to the site and share the link to view it, the videos open only in Playit android app. Only first 15 seconds can be viewed after that a screen appears showing "to play the video, install Playit app from playstore". What is happening to the videos in the backend when we upload on pdisk.net website? I think the site is owned by Playit app only. I noticed that the uploaded videos use final url a6.hentai.com...etc to stream the videos which can be streamed fully using the app only.
Can someone tell if the videos are encoded or encrypted backend and the app is made to decrypt the videos? Is such thing possible?
'''no code req.'''
In their FAQ page, they have mentioned that:
Video downloaded by Apps uses Smart Muxer technology.Smart Muxer is a
unique technology developed by PLAYit, can merge the video and audio
within seconds without any extra recoding and storage. It’s really
workable when there are some videos have no build-in audio and need to
be merged in the devices with low configurations. Due to the unique
technology, the video can be only played by PLAYit and the other
main-stream players can’t support. And videos shared to social apps
can also be opened in PLAYit.
I found one of the discussion in reddit, as mentioned by one of the users:
They encrypt the normal mp4 video in some kind of way which enables
them to limit the playback to their app.
As for documentation, there is not much available online. But found this feature request in VLC forum.

StageVideo fallback in Air mobile doesn't work. Video component won't play .mp4

So with StageVideo you can play a h264 .mp4 file, and by any example which I found you need to have a fallback Video component.
Problem is that I was unable to play the .mp4 video files with the Video component on a mobile device, Android or iOS.
.flv works fine, but I can't have backup video files as it takes too much space.
Is it really necessary to have the fallback to the Video component? what are the chances it will fail?
Thanks.
From my experiences (I've created 3 separate AIR VOD apps for both iOS and Android), the following is true:
StageVideo works on Android 4.0+. I was unable to get it to work with 3.x, but I have been told it works. I can, for sure, confirm that it does not work on 2.x.
StageVideo works on iOS 5+. On iOS 5, you will need to play a silent sound at startup to make sure sound works, but you should do that regardless since the iPad 2 rarely plays sound without doing that. It is a known bug in AIR that, as far as I know, has never been attempted to be fixed
iOS can only play h.264 MP4s through StageVideo and StageWebView. They will not work in Flash video players (including VideoDisplay, the base for Video and all OSMF-based players). I do not recall the exact reason for this, but I believe it has something to do with the MP4 requirement for hardware accelerated playback.
iOS can play FLV and, maybe, F4V through the Flash video players described in #3. This will lack hardware acceleration, however. That means your video and your UI will run on the same thread and share the same process. Basically, lower framerates while video is playing. Additionally, CPU decoding is a battery drain.
Android is a little more wild. You cannot use StageWebView for any playback as of Android 4.3 (have not tested on 4.4 yet). You can use Flash video players for h.264 MP4s... on some devices. I've found that they seem to work fine on Android 3.0+ on all devices I have tested. Keep in mind that is only a couple dozen out of over a thousand possibilities, though. On 2.x, it is extremely hit-or-miss. It seems to work fine on HTC and Motorola devices (which I've tested on), but I have had reports from users who cannot playback on Samsung and Sony devices.
As you mentioned, a fallback player is definitely recommended. Without having multiple sources/encode types, the fallback is useless on iOS, however. I currently have an app in the Play Store (All About Trikes) that was originally released without a fallback player and just used a StageVideo implementation. A day after release, we started getting reports that users on 2.x couldn't play videos. We had to scramble. We first released a version that couldn't be installed on 2.x and then another version that uses Flex's VideoDisplay as a fallback, which seems to have fixed the problem for those users, but I know there will be others than cannot playback video.
Long story short, there is no fool-proof way of playing back h.264 MP4s on mobile using AIR. You do want to include a fallback player, regardless of platform. Ideally, if you are streaming the video, you should have both h.264 MP4s and FLVs available with the fallback using FLVs instead of MP4s.
Hopefully that helps.

Playing videos in a browser cross device

I want to embed video's on our website that should work with these restrictions:
The video needs to start as soon as the user clicks on play. As far as I can tell this means that the video must be either streamed or it must use progressive downloads.
The video must not be downloadable by sending the link to other people.
The video must be protected against being viewed without being allowed to do so.
The video must work on all devices, also the ones that do not support flash such
as iOS and android
As a backend I use amazon cloudfront. So far we have used RTMP, but that obviously does not work for iOS or android devices.
What we’re planning to do is this:
For flash platforms we use RTMP with the amazon signed URL’s to prevent anyone to view the content.
For iOS we want to use HLS with a generated m3u8 file that contains signed URL’s to the TS files
For Andoid devices I'm not yet sure what to use.
My questions are these:
Is this a viable setup, or are is there a superior setup that ticks all the boxes?
What should we use for the android case?
I would suggest, use pre-signed hls/m3u8 for both ios and flash.(https://github.com/mangui/HLSprovider). For Android you can use normale html5 video streams with quality selection (signed URLs of course).
For Android you have to use RTSP protocol.
Wowza media server is the perfect solution for you.

Playing youtube video in Android app

In my Android app I'd like the user to tap an image once, have a youtube video play automatically and when the video is done the user is immediately returned to the app. What's the best way to do this in Android?
I tried using intents. This works in that the video comes up on what I think is a youtube web page. However playing the video requires another tap. I'd like to avoid this if possible.
I tried the whole MediaPlayer, prepareAsync, setOnPreparedListener and never got it to work. For some reason onPrepared was never called. No exceptions were thrown. I'm using the emulator to test and I'm new to Android so I'm not sure if the behavior will be different on physical devices.
I got this working well on iOS by getting creative with webviews. I'm hoping it's more straightforward on Android. The docs sure make it sound straight forward.
Cheers!
Update: Everything below is still correct, but the official YouTube API for Android is now available.
By far, the easiest way to play a YouTube video on Android is to simply fire an Intent to launch the native Android YouTube app. Of course, this will fail if you are not on a certified Google device, that doesn't have the complement of Google apps. (The Kindle Fire is probably the biggest example of such a device). The problem with this approach is that the user will not automatically wind up back at your app when the video finishes; they have to press the Back button, and at this point you've probably lost them.
As a second option, you can use the MediaPlayer API to play YouTube videos. But there are three caveats with this approach:
1) You need to make a call to YouTube's GData webservice API, passing it the ID of the video. You'll get back a ton of metadata, along with it the RTSP URL that you should pass to MediaPlayer to play back an H.264-encoded stream. This is probably the reason why your attempt to use MediaPlayer failed; you probably weren't using the correct URL to stream.
2) The GData/MediaPlayer approach will only play back low-resolution content (176x144 or similar). This is a deliberate decision on the part of YouTube, to prevent theft of content. Of course, this doesn't provide a very satisfactory experience. There are back-door hacks to get higher resolution streams, but they aren't supported on all releases of Android and using them is a violation of YouTube's terms of service.
3) The RTSP streams can be blocked by some internal networks/firewalls, so this approach may not work for all users.
The third option is to embed a WebView in your application. There two approaches you can take here:
1) You can embed a Flash object and run the standard desktop Flash player for YouTube. You can even use the Javascript API to control the player, and relay events back to the native Android app. This approach works well, but unfortunately Flash is being deprecated on the Android platform, and will not work for Android 4.1 and later.
2) You can embed a <video> tag to play YouTube via HTML5. Support for this varies between various releases of Android. It works well on Android 4.0 and later; earlier releases have somewhat spotty HTML5 <video> support. So, depending upon what releases of Android your application must support, you can take a hybrid approach of embedding HTML5 on Android 4.x or later, and Flash for all earlier versions of Android.
There are several threads here on StackOverflow about using HTML5 to play YouTube video; none of them really describe the entire process you must follow in one place. Here's links to a few of them:
Android - How to play Youtube video in WebView?
How to embed a YouTube clip in a WebView on Android
Play Youtube HTML5 embedded Video in Android WebView
All of this will get dramatically easier in the weeks/months to come; at Google I/O 2012, they presented/demoed a new YouTube API for Android that will support direct embedding of YouTube content in your application, with full support back to Android 2.2 (about 95% of the Android userbase as of this writing). It can't arrive fast enough.

Best HTML 5 video solution for mobile devices?

I'm developing a mobile video platform and I have playing in mobile safari and some Android browsers. The problem I'm having is that my solutions thus far (have tried regular HTML 5 video as well as VideoJS) have only worked on about 50% of the Android browsers I've tested.
I have added the three web formats to my video tag (ogv, webm and mp4) as well as provided a fallback flash object but it seems that a lot of the Android mobile browsers still refuse to play any video.
Has anyone had a similar experience that could propose a solution?
Thanks,
gearoid.
Strange resolution with this one. I need to add the video sources in the appropriate order to get multi-device compatability. The sources need to be added to the video tag in the following order:
MP4
WebM
OGV

Categories

Resources