I have an webapp made in sencha-touch that plays different audiofiles from URLs. It all works great, but when I add it to homescreen (on my iPhone 4s with IOS 7) everything but the audio is working...?
The way the audio is added is:
xtype: 'audio',
hidden: true,
url: '/audio/crash.mp3',
The correct audio-URL is added from store later.
I then have a button that finds the audio and sets:
audio.toggle()
Why is it not working when I add it to the homescreen? Is it a sencha or an ios7 problem?
For those who have the same problem: It didn't work with the xtype: audio. I don't know why, but i think it is a bug in ios7 or something. The sollution or "quickfix" i did was to add an audio-tag with javascript and just play that.
var a = new Audio("YOUR AUDIO URL"); a.play();
Related
Here is my m3u8 file:
cat 8.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:YES
#EXT-X-MEDIA-SEQUENCE:1131
#EXT-X-TARGETDURATION:5
#EXTINF:4.950, no desc
1545049888215.ts
#EXTINF:4.950, no desc
1545049893218.ts
I serve it at as static file at http://104.248.205.68:31339/8.m3u8
I use mediaelemnts.js to run this hls video: jsfiddle
html:
<video width="240" height="160"
id="player1" src="http://104.248.205.68:31339/8.m3u8"
controls="controls" autoplay preload="auto" muted ></video>
js:
$('video').mediaelementplayer({});
It works fine on chrome mac os desktop. But not working on iphone 8+ (safari and chrome). No errors in the console. Video just not played, black screen. In the fullscreen mode of video - the same.
At the same time, if I find a random m3u8 on the internet and use mediaelemnts.js to play it, it works well on the iPhone (at least in fullscreen mode) jsfiddle 2.
So I guess something wrong with my m3u8 file since other m3u8s are runnable on the iPhone.
If I open network tab while loading the problem page on Iphone, I see it's downloading the files but not showing video for some reason.
Update
I checked on android: galaxy s5 and galaxy s9+ in chrome: both works.
Update 2
Zip archive with ts files and m3u8: http://104.248.205.68:31339/8.m3u8.zip
When inspecting the media files [1] it can be found that the PMT (Program Map Table) signals that there is audio in the stream, but there are actually no TS packets for audio (i.e. no audio data) present.
It looks like the player waits for the audio TS packets in order to build a common buffer for both, audio and video, and only then start playback. Since the stream lacks audio data that never happens. To back that up, you can use ffmpeg to remove the audio track from the media segments using the below command and find that playback would work once you do this.
ffmpeg -i 1545049893218.ts -an -vcodec copy 1545049893218-v.ts
Further, the reason this problem only manifests in Safari and Chrome on iOS is that in those cases mediaelement.js is using the browser's native capabilities to play HLS, instead of a JavaScript player (like hls.js) which is used on other platforms (e.g. Chrome on desktop) and is more tolerant to such problem cases.
[1] E.g. using http://thumb.co.il/ or ffprobe
EDIT:
While the above may be sufficient to make it work on older Apple mobile devices - I tested on iPhone 6 iOS10 - newer devices seem to be more restrictive. The official HLS Authoring Spec states
8.11. You MUST provide at least 6 segments in a live/linear playlist.
which does not seem to be a hard requirement on some iOS versions. However, to ensure it to be working on all versions these requirements should be met.
I did a quick test on iPhone X with iOS12 and found it would play if at least 3 segments are provided in the playlist by just duplicating the last segment entry.
I have a .wav that I want to play when a person clicks on a link. How do I go about doing that? I'm not exactly an expert at html or css or javascript so be gentle with me
Reference
Playing audio with Javascript?
Example
Two Links
Play
Stop
jQuery click Events
$(document).ready(function(){
var audio;
$("a.playButton").click(function(){
console.log("playing");
audio = new Audio('http://download.wavetlan.com/SVV/Media/HTTP/WAV/Media- Convert/Media-Convert_test1_Alaw_Mono_VBR_8SS_16000Hz.wav');
audio.play();
});
$("a.stopButton").click(function(){
console.log("Pause");
audio.pause();
});
});
Now this probably isn't the most accurate way to do this but it gives you an idea of how this works. If you want to use the built in audio tag you can do that too cause that will give you the controls and other helpful things.
JSFIDDLE
https://jsfiddle.net/pzth1zd5/
I have a silent movie (No sound at all in that clip) which acts as a background movie for my view.
When I play music with iPod and then open my app the iPod music stops.
I don´t want my movie to interrupt the iPod Audio. I´ve read that UseApplicationAudioSession is deprecated but how do I realize this now?
Thank you for your help!
EDIT: And because I add an image onto the MovieplayerViewController I can not use AVPlayer.
PS: Other threads I´ve found here do mention the deprecated UseApplicationAudioSession solution thats why I opened a new question.
Thanks :)
Here is my solution:
AVAudioSession audioSession = AVAudioSession.SharedInstance();
NSError audioSessionError = new NSError();
audioSession.SetCategory(new NSString("AVAudioSessionCategoryAmbient"), out audioSessionError);
I have a problem using MediaRecorder to record video with ActionBar Sherlock. I have a base app that sets up and records video files without any problem, but as soon as I add ABS, it stops working.
Right now I have a non-ABS app that can record video with no problems at all and the same app (in all other respects) with ABS that doesnt work.
Initialising the video recorder using the CAMCORDER settings gets through the MediaRecorder setup OK, but when I stop recording, I get a '-1' error in the logcat and the resulting .MP4 file has no audio or video track (although the file size looks OK).
If I try setting MediaRecorder with maunaul setups (i.e., format, frame rate, size etc), the setup keeps falling over at 'setVideoSource...CAMERA'.
Does anyone know if there's any reason why ABS would upset MediaRecorder this way?
Added 01/01/13:The application I'm working on is being upgraded from a photo-taking app to a video-recording app. The preview for the camera was previously done with a ImageView frame, which works OK for providing an image preview, but not for use as the video preview on MediaRecorder. For MediaRecorder, I needed to use a SurfaceView. Once I switched to a SurfaceView, all was good!
I have an HTML/JS app running in a webview in an iPad app. The app uses the HTML5 video tag. Videos work fine in iOS4.3 but today I've tested on iOS5 and the videos simply do not show up.
I have verified that it is not a layout related issue by setting background color and borders on the video element.
The same behaviour is evident irrespective of whether the app is run directly in mobile safari /from the home screen or within the webview.
The template for the video is simply:
<video controls src='{url}'></video> //where {url} is substituted at runtime.
The relevant video url plays correctly directly in the mobile Safari on iOS5.
I have tried to proxy the app comms and it seems that it does start loading the video but then stops, no video controls show and only the background color I have set shows thru.
Any ideas would be greatly appreciated. Thanks.
Have you tried create an empty webview, without additional parameters and scripts and make sure that you call it only once? I had the same issue when i call it twice without clearing previously created one - just audio was played.
Try to look at http://blog.millermedeiros.com/2011/03/html5-video-issues-on-the-ipad-and-how-to-solve-them/ and see if the fix works for you...
he he - should have read the fine print - did not notice you had answered yourself - remember to tick the thread off as answered
I've fixed this in code by changing the width and height by a pixel once the video element is created. Must invoke a repaint or something to that effect