Set JWPlayer User-Agent? - javascript

Is it possible to set the user agent in JWPlayer ? I have a streaming link that checks to see if the user is on an ipad, and will only work if this is the case. In VLC, I can set the player declare itself an ipad. Just wondering if this is possible with JWPlayer

Related

Youtube Javascript API not allowing playback control on mobile even when initiated through user input

In the following fiddle there are external controls for the youtube player. They work fine on desktop browsers, however in a mobile browser the play button fails to start the playback of the video.
https://jsfiddle.net/wittjosiah/oLxv6ep2/
According to the Apple Developer Library:
In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it. This means the JavaScript play() and load() methods are also inactive until the user initiates playback, unless the play() or load() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad="play()" event does not.
However, in this scenario the play() method is user-triggered but is still failing to initiated playback on both the iPhone simulator and my iPhone 6S.
Am I missing something? Is there a reason this isn't working? Youtube's mobile site initiates playback from a user-action so it must be possible. Any help is appreciated.
YT.Player does not guarantee that playVideo() will work in all mobile environments.
Try setting the preference MediaPlaybackRequiresUserAction to true

How can I detect whether or not a device uses it's own video player rather than the HTML5 player?

How can I detect whether the actual HTML5 player is being used, or if a 3rd party player is hi-jacking the video outside of HTML5?
iPhone doesn't use the HTML5 video player (thanks Apple) but rather uses its own player full-screen. This means any apps, regardless of responsive design, don't work if they expect an interface to be involved with the video.
So I need to know this in order to either make my app work differently with devices that do something similar to iPhone, or at least fail gracefully.
As I told in you in my comment, it seems that is not possible.
So I am afraid that you will need to go for agent sniffing. Check this post to see how to identify an iOS device.

External play button iPad

Is it possible to make an external play button for a video without the play button in the video?
For example when you want to start a youtube video you see a red button in the middle of it. I want that hidden and a button outside of the video to start the video. It doesn't matter what video player it is.
I want to do this because iPad does not allow autoplay. And using the external button I want to trick it to autoplay.
This is a website that does "autoplay" on the iPad.
http://24hoursofhappy.com/
There is a reason why YouTube doesn't allow autoplay on mobile/tablet devices, video's use up alot of bandwith which may become expensive for the user.
U can trick it like u mentioned with a custom play button or even force it to start playing without a custom button. There is alot of detailed information on YouTube's API page.
Check out this page: https://developers.google.com/youtube/
I'd refrain from always autoplaying a video though if not just for bandwith reasons. In your case u could check if the device is a tablet.
I finally found an answer for this using HTML5 videos. It allows me to use the control buttons externally so I can use an overlay and hide the overlay when the play button is clicked so it will seem like it is auot played.

How can I simulate a touch in a UIWebView?

I want to automatically play a YouTube video but because of how YouTube's view counter is set up, autoplay views will not count as views.
How can I simulate a user interaction tap in a UIWebView so YouTube thinks that the user pressed/tapped play?
Or do you "think" that a very near version of iOS will support this?
Trying to phrase that in NDA accordance. Do you think it would work if I changed the user agent of the UIWebView to a desktop user agent and displayed a standard YouTube page?
On the desktop YouTube videos autoplay on Youtube.com but this does not work on mobile.
I have set mediaPlaybackRequiresUserAction to no.

How can we find out value of webview.MediaPlaybackRequiresUserAction using javascript

I have to play video (HTML5) on iOS in autoplay mode, but for that we need to set webview.MediaPlaybackRequiresUserAction as FALSE.
Is there any way to check the value of webview.MediaPlaybackRequiresUserAction=FALSE or TRUE, using JavaScript?
I think it is not possible as apple doc say
User Control of Downloads Over Cellular Networks
In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it.
ref:- http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
autoplay will work if you also set muted, the problem is as soon as you turn off the mute, the video stops.

Categories

Resources