I am trying to use react-native-video in my app but when video plays, audio is not playing. Only video without audio is playing. (In Android, both video, audio is playing well. Only in iOS, audio is not playing)
I found a solution on github and tried it, but got a new error. How to fix this new error?
Here is the link.
This is new error.
In order to solve that compilation error, you'll need to add this to the top of the file you added the AVAudioSession code to:
#import AVFoundation;
OR (this is the one they show in the example):
#import <AVFoundation/AVFoundation.h>
(The first one doesn't require that you add the framework -- see #import vs #import - iOS 7)
Also, just wanted to make sure you had also tried this fix listed on the answer page you linked to:
<Video
...
ignoreSilentSwitch="ignore"
/>
Related
I am working in a project in which I am using UIWebView. The Project is in Objective C. I tried to load HTML string in a webView which contains Audio. But some how Audio is not getting play in iPhone. But it's playing in iPad. I tried to find the problem which I am getting. But unfortunately I couldn't found any solution for this. Please help me in this.
UIWebView is deprecated and not supported by apple anymore.
I might consider using the new framework - WKWebView.
You can import it by using
#import <WebKit/WebKit.h>
Any one please help me… my app is based on showing subtitles under video…I did little bit in that by using Movie Player project from developer.apple, I can play and pause the subtitle while play and pause the video. I have a problem with how to synchronize the video with subtitle such as forward, backward, slider,entering full screen. I looking for an example like synchronize .srt file with MPMoviePlayerController in Xcode and also other..Please discuss your idea in that with me... Thank you
I have created an overlay to an MPMoviePlayerController using the following code, which essentially adds a subtitle in my iphone xcode project:
[_mpMoviePlayerController.view addSubview:lblOverlayView];
I want to now be able to save the video (and eventually facebook, but I don't NEED help with that, just the saving would be fine) with the subtitles. It is playing a preloaded video, and the dynamic part is the subtitle, which is whatever text the user enters (which becomes the value of lblOverlayView. If you have any other ways of adding text that can very over the top of a preexxisting/preloaded video and then saving/emailing/facebooking it, that would also be great! Just some way of doing it!!
Any help I can get will be hugely appreciated.
Ok so I've looked around at the majority of other problems people are getting with vimeo and I don't think they've hit upon the same issue I've been getting.
When I open up a vimeo video on the Safari app on both my iPhone and iPad, they both work fine no problems.
Now I have created an iPhone app which has a UIWebView and loads a vimeo player video and that works fine too.
The issue is if I now install the same app on my iPad, the vimeo player refuses to load the video, it just hangs and the spinner keeps on spinning but the video won't load.
However, now what I did after that was create a basic app which loads a vimeo player URL in a UIWebView as a native iPad app, not an iPhone app which is resized or "2x" to fit an iPad. Surprisingly, this worked fine.
So now I'm confused... why is it that the iPad will not play the vimeo video if it's not running an app designed for the iPad? Is there some special magic going on behind the scenes which might break this?
I'm at a loss here, any help would be appreciated
Implement the delegate method : shouldStartLoadWithRequest then in that method just detect that whether the requested URL is of type VIDEO if it is then please follow the code given in below link which worked for me :
Playing a video file from server in an Iphone app
This will be good in playing any video.
The problem is likely with the user agent which is different from Safari's one on Apple devices: UIWebView sends some invalid string causing Vimeo (and sometimes YouTube) to break.
Luckly, you are allowed to override app's user agent using the following (C#, let me know if not clean enough):
NSDictionary dictionary = NSDictionary.FromObjectAndKey(new NSString("Mozilla/5.0 (" + (UIDevice.CurrentDevice.Model.Contains("iPad") ? "iPad" : "iPhone" ) + "; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25"), new NSString("UserAgent"));
NSUserDefaults.StandardUserDefaults.RegisterDefaults(dictionary);
This makes the videos play just fine.
I've been struggling to make video on the iPad work. I'm using an MPMoviePlayerViewController and it plays fine in the simulator. I've tried several different converters, including ones dedicated to producing iPad-formatted video, but none of the videos play on the device. The MPMoviePlayerViewController loads and the controls appear.
For most of the videos, the spinning progress indicator never goes away. For a few, the video loads but when I press play the video immediately pauses. I know that the video is there because I can scan through and see various frames.
I know the code works because it plays a different movie file perfectly. I just have no idea what I'm doing wrong that's preventing my movie from playing. Does anyone know a good step-by-step process of getting an iPad-formatted video from any .mov or .mp4?
Thanks,
Luke
Also, just for future reference, import target video into iTunes, then highlight it and from the Advanced menu choose "Create iPod or iPhone Version" or "Create iPad or AppleTV Version" depending on your target device.
This guarantees that the right codecs are used and the right bitflags set on the video file.
Fixed - the one that loaded but couldn't play eventually worked. Why? Who knows.