HTML Music app not supporting iPhone background play - javascript

I created a music app using html and js. It works in background when I run in safari (iOS)But it not supporting multitask and background when I run natively in iPhone.
Any suggestions.

I assume you're talking about the difference between visiting the site in Safari vs standalone (i.e. accessing it from the home screen, assuming the mobile-web-app-capable meta tag is present).
Currently, only iOS5 supports background audio playback for standalone web apps. Anything prior to that won't work.

Related

How to embed an inline PDF file in a web page that will be viewable on Android?

I'm looking for how to embed a PDF file in a web page that will be viewable in the native Android browser / Chrome. If I use something like this:
<object data={'LINK_TO_PDF.pdf'+'#zoom=100&scrollbar=0&toolbar=0&statusbar=0&messages=0&navpanes=0'}
type='application/pdf'
width='100%'
height='90%'>
<p>This browser does not support inline PDFs. Please download the PDF to view.</p>
</object>
It works great on Chrome, FireFox, and Edge on Windows. It works great in Safari on iPad (iPadOS) and Safari on iPhone (iOS).
But it does not display on Android.
The files are not publicly accessible, so I cannot use the Google Docs viewer.
PDF.js doesn't seem to help. PDFObject doesn't seem to help. I've looked a bit at ViewerJS.org, but most of its source code has not been updated in 7yrs.
I've seen lots of questions and answers about this, but most of them are old. Surely in 2021, there's a way to do this that works with Android?
(Having to download the file, open it up in a third-party PDF Viewer app, and then close it, switch apps, delete the PDF, and go back to the webpage seems very backwards.)
How can this be done to provide a good user experience on Android?

YouTube video wants to download instead of load via jQuery

In short, mobile browsers try to download a random file instead of loading video into the main player Website.
More info:
I've built a webseries type site on WordPress, that uses jQuery to load a video into the main player: http://suzellediy.com/
Recently, I made it responsive - and now, when testing on mobile, when clicking on the video thumbnail, the video does not want to load into the main player.
Instead of loading the video, mobile Chrome and Safari wants to download the file instead. The issue cannot be recreated by using firebug / chrome mobile emulator.
Any ideas what the issue could be?
Actually you may be able to reproduce the issue on the desktop when you disable Flash.
Try changing the URL in:
jQuery("#mainplayer").attr("src", "http://youtube.com/v/WKmUqV7abgw"+
"?&autoplay=1&loop=1&listType=user_uploads&list=suzellediy");
To this:
jQuery("#mainplayer").attr("src",
"https://www.youtube.com/embed/WKmUqV7abgw" +
"?autoplay=1&loop=1&listType=user_uploads&list=suzellediy");
Or this:
jQuery("#mainplayer").attr("src",
"https://www.youtube.com/embed/WKmUqV7abgw" +
"?autoplay=1&loop=1&listType=user_uploads&list=suzellediy&html5=1");
and see if that works.
Most likely what you see is that mobile browsers that don't support Flash try to download a file if they can't play it.

Mobile youtube video and its HTML5 player

I am trying to open m.youtube.com using an ordinary browser but to be able to play the videos using HTML5 (instead of the default RTSP playback). To do that, I spoofed User-Agent in Firefox, and added there a string corresponding to iPhone's Safari UserAgent string. After I've done that, I see a nice "iPhone-like" version of the Youtube (instead of an ordinary m.youtube.com for other mobile devices). But the video, when selected, is not being played (on a "User-Agent-spoofed" Safari i can hear only sound, on "spoofed" Firefox the video is hung with a spinning "video is loading" icon). Why that might happen? what kind of features of Safari for iOS HTML5 version of youtube site may use that the video is not played in desktop Safari and Mozilla?
I have checked the Desktop browser requests and responses with Wiresharked, and found the GET request which corresponds to the video asked (the request's Content-type is video/mp4). But the playback works always only on the iPhone's Safari.
What may be the reason? I tried to look into HTML5 code of the Youtube page that contains video player, but there's so much JavaScript (most of HTML is being generated dynamically) that I got lost in it.
Is there any way to make it work on ordinary browsers (I can modify the requests/cookies on-the-fly)? I'd like to have an iPhone-styled youtube with HTML5 on my desktop browser.
Thank you

Embed a video to a webpage that will work on Blackberry/Windows Phones

I have been looking for an answer to this for a while with no luck. This SO question gives a lot of detail to the problem I am having, but is unanswered:
I'm trying to embed a video on a website that will play on blackberry
and windows mobile 6.5 devices (currently testing on a blackberry
curve and acer betouch) but don't seem to be getting anywhere.
Blackberry Flash doesn't work, and HTML5 video doesn't either. I can
play video in the browser on youtube so can see that it is possible -
using third party services like youtube isn't really an option either.
Windows mobile 6.5 Same deal really, though I think Flash is the way
to go (http://www.adobe.com/software/flash/about/ says the device has
flash version 9.1.something installed) but still just getting a little
triangle with a 9 in when I test it.
My question is: How would I embed a video to a webpage for blackberry and windows mobile?
I think that using the <object> tag would be safest, as Blackberry and Windows Mobile devices should both support it. Here's a link to the Blackberry developer blog, where they explain embedding video/audio objects so they are viewable on a Blackberry device. This method should work for Windows Mobile devices as well:
http://docs.blackberry.com/en/developers/deliverables/6176/HTML_ref_object_564145_11.jsp
For a full overview of HTML 5 video and flash fallback (to support all devices) consider reading here..
http://diveintohtml5.ep.io/video.html
Vorbis OGG may be the safest bet..

Javascript Mp3 Player, NONE FLASH

I currently have a simple flash Mp3 player on my site which works lovely. The issue is, most cell phones do not support flash and a large portion of my visitors come through via a mobile device. The alternative to this is to replace the flash player with a javascript player. I found a JQuery one but it only works on HTML5 compatible browsers. Does anyone know of a good alternative that would work on mobile devices as well as most desktop web browsers?
You can check if the browser supports the HTML5 audio tag if not, use the flash version.
Check out jPlayer.

Categories

Resources