javascript function that changes the orientation of a device - javascript

I'm creating a desktop application that assists in posting story on instagram, but I'm facing a problem. I use a cell phone simulation to open instagram, and to post instagram, it asks me to rotate the device. I've tried everything, but nothing works. I would like to know if there is any javascript function that changes the device orientation.

With the JavaScript Function
screen.orientation.lock("portrait")
or
screen.orientation.lock("landscape")
you can Rotate the Device in the Web View

Related

Signage application with Mobile Remote

My goal is to create a webpage that only displays a full screen video on a TV. Then have a second webpage someone could open up on their mobile device (via a QR code) and have a choice of 4 videos. Once you tap a video on the mobile device, it changes the full screen video on the tv. What is the best way to do this? I was thinking via a MySQL DB storing the webpage, then using JS to check if the content in the DB has been updated, and if it has, make the change on the tv. Is this the best way?

Continue running WebApp with "Screen off/Background" on mobile devices

I am making a WebApp that uses WebSpeech API for Text to Speech.
The problem I am facing is that whenever the screen goes off or
browser window is switched, particularly on mobile devices, the speech
synthesis is just stopped. When the text to be read takes longer time,
the device screen times out, the reading progress is lost, which is
really bad UX.
The basic synthesis controller is is created by const synth=window.speechSynthesis; which is attached to window.
I have overcome with a dirty workaround of keeping the screen on by using NoSleep.js, which essentially plays a video in the background to keep the device awake.
However, I noticed that some music players can play audio when browser is minimised and even when the screen is turned off. Example: wynk.in
Is it possible to achieve the same in my case? Any inputs on how is it done in music apps? Is attaching to anything other than window going to help?
Link to my WebApp: https://yakshag.github.io/tts.html
Link to my JS Script: https://yakshag.github.io/js/tts.js
PS: I am a beginner in JavaScript :p

scan barcode in a web application

I'm building a web application (C#) for a customer.
Now I'm trying to add a page for mobile. I want that the customer will be able to scan a barcode (1D barcode or 2D barcode) and the code will be written in a text field (<input>) on the screen for further operations. It must work on android or iphone, and better - on both.
I tried to use JS codes which I can take a picture with the camera in the mobile device and the script reads the barcode in the picture - but I didn't find something good enough.
this one didn't work with large images from the camera, and this one couldn't read some of my barcodes and also couldn't read large images.
I tried to find a way that the customer will click on a button to open a barcode-scanner-application on the device (I have an android mobile device) - and the barcode will be written on an input on the screen, but I can't find if it's possible and how to do it.
I don't want to use phonegap - I need it as a web application, not a native app.

How does google show this special iOS advert?

Hi all sorry if this is repost. I really searched but can't find anything on it.
I always see this special ad when I use google services on my iphone or ipad. This little window animates out looking like a chat box. I can detect iOS device using user agent but how do I make the advert appear like google does? Specifically, try to open google maps.
I would like to use a window like this when users use iOS device to access my website. It is the most elegant way to tell iOS user about your app while not annoying them with some roadblock each time you try to access with iOS device.
Here is an image of what I'm talking about:
You can use this Javascript: http://cubiq.org/add-to-home-screen
I don't know whether this is your expectation, When your page has access from any iOS device, you wanted to bring up that dialog in webpage Right?..If That is the case then just retrieve the os info and make check there and do your presentation as you want.

Integrating HTML5 into native iPad application

I am trying to integrate a webpage into an iPad application. Something like the Final Hour app where the app is a native app using slideshows. some of the slideshow pages have a small part that is loaded from a website.
The only way I would have known this was when I didn't have internet access the small area where the website loads into said there was no internet connection.
How can I implement something like this? I understand the website aspect but I don't understand what iOS API they use to setup some sort of canvas or frame to hold the website.
Here is an image of the app. The webpage would be loaded into the "blue" box outline.
You are indeed looking for a UIWebView. You need to build the controls yourself if you want your users to navigate in the website. If you just want to show one page, with no Back or Reload button, then you can use it as is.
Note that you should try to make it clear to your users that your app might not work properly if no Internet connection is available.

Categories

Resources