?
Solved

Starting a video from web page on iPhone

Posted on 2014-08-29
3
Medium Priority
?
283 Views
Last Modified: 2014-08-30
I am currenly using JWPlayer as my HTML5 video player, but this issue applies in general to iOS.
You can't autostart/autoplay a video from a web page on iPhone because iOS disables the feature.
You also can't simulate a button click in javascript to start the video on page load.
The only way to get a video on a web page to start playing is to touch a link or button on the screen.
I am trying to figure out how YouTube gets their videos to start.

Example -
(On iPhone 5) -
You go to http://m.youtube.com and it shows you a bunch of images of videos.
When you touch one of the images it then appears to reload the page with a query string - e.g.
https://m.youtube.com/watch?v=PkWxVG77xVk

And as soon as the page reloads, the video starts to play.

Does anyone know how they are doing this?

Thank,

Kevin.
0
Comment
Question by:kevinvw1
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
Kyle Hamilton earned 2000 total points
ID: 40294360
youtube on mobile is a javascript app. so that is not a page reload. you have to click on a video to have it play. notice that if you go directly to the second link you provided, the video does not play automatically.

you cant do it, and you shouldn't want to. ask anybody if they appreciate when video content starts playing automatically in their browser. if someone wants to see your video, they will click the play button
0
 

Author Comment

by:kevinvw1
ID: 40294575
I don't want the video to completely autostart.  I want to do what YouTube is doing.  

But I think I understand what you are saying.

I didn't realize that you can manipulate the URL without a page reload.

I will investigate that route.

Thanks,

Kevin.
0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40294582
yes. you can use push states. if you look into any of the js frameworks, like backbone or angular, that's how they do it.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question