Giter Site home page Giter Site logo

HTML5 Audio Tag Autoplay about baker HOT 10 CLOSED

simbul avatar simbul commented on August 23, 2024
HTML5 Audio Tag Autoplay

from baker.

Comments (10)

folletto avatar folletto commented on August 23, 2024

Our plan is to use the current WebKit engine, so for now I don't think we are going to re-implement it. However, are you sure you can't do that even today with a little of javascript attached to the ready event of the page?

from baker.

vanderbreye avatar vanderbreye commented on August 23, 2024

yes, JS will work, you can trigger the play/pause event of the html5 player easily.
btw., autoplay for video works fine in webkit..

from baker.

nin9creative avatar nin9creative commented on August 23, 2024

I did find some Javascript stuff online after I posted this comment... However in some of the comments on a couple blog posts people mentioned that the autoplay workaround using Javascript was broken in iOS 4+.

I haven't been able to get anything to work. Maybe I'm a moron though. I've dorked around and can't get JS to trigger the play event.

@vanderbreye - do you have any example that you know works?

Thanks guys!
Andrew

from baker.

vanderbreye avatar vanderbreye commented on August 23, 2024

sure. it is only video, but i assume, this would work on audio as well..

<script>
$(document).ready(function() {

function playPause() {
  var myVideo = document.getElementsByTagName('video')[0];
  if (myVideo.paused)
    myVideo.play();
  else
    myVideo.pause();
}

   playPause()
 });
</script>

for video, this is clearly running on IOS 4+.

from baker.

Xm4s avatar Xm4s commented on August 23, 2024

UIWebView has an attributes "mediaPlaybackRequiresUserAction" from iOS 4.0+, default YES
Reference: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html

from baker.

nin9creative avatar nin9creative commented on August 23, 2024

Thanks Xm4s... After changing that default setting in the actual Baker Framework code, I'm able to use the autoplay feature of the HTML5 audio tag and it works great. Thanks for posting that!

Andrew

from baker.

 avatar commented on August 23, 2024

Hey, i'm new here, sorry if i'm not already at the same speed of all of you.

I've developed a simple page with audio inside. It's html5, mp3, and with standard html5 works.

The problem, or better the feature needed, is that the reader can't change page without stopping the audio / video.

I understand this can bring the discussion far from the direction of this thread, but I'm working to find a solution to have audio / video without iframes even changing the pages. Is someone working on this matter ?

from baker.

folletto avatar folletto commented on August 23, 2024

If you need a background audio I think you can just add that in Objective-C and control it maybe through javascript calls. Unfortunately there's nothing "native" in HTML that persists through different pages.

from baker.

 avatar commented on August 23, 2024

Yes, this is what I was thinking about. Could be an extension of HTML: [a href=url target=_player]with or without text[/a] Loading the page the app should show a play button at the bottom of the screen, for example. This is the idea. I'll try even if I'm a newbie in C.

from baker.

folletto avatar folletto commented on August 23, 2024

I think we can mark this as closed, tho. :)

from baker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.