Cannot play youtube videos via youtube API on Samsung Galaxy Tab 2 7.0's default browser

Ser5

I'm trying to start playing youtube video via youtube API. On most browsers it does work, but on Samsung Galaxy Tab 2 7.0' default browser it does not.

On most browsers the video starts playing automatically when the page loads.

On SGT7 it starts loading video, then black screen appears with some icon in the upper left corner that looks like a "film" or a "key". It does not respond to user input.

I tried installing Firefox on that device and it does work OK.

You can see the example here: http://ser5.ru/t/yt_api.php

The source code of this example is placed below. As you can see, I'm using embed code from API help: https://developers.google.com/youtube/iframe_api_reference

So, the question is: am I able to start youtube videos on that specific browser via API or should I use some other way?

<!doctype html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<div id="player"></div>

<script>
(function () {
    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
})();
function onYouTubeIframeAPIReady () {
    player = new YT.Player('player', {
        height: '390',
        width: '640',
        videoId: 'M7lc1UVf-VE',
        events: {
            'onReady': function () {player.playVideo()}
        }
    });
}
</script>

</body>
</html>
Damo

I noticed the same behavior on this device and others

player.playVideo() will not play the video, this seems to be intended by design as AutoPlay is not allowed on mobile devices to prevent unintended data charges.

You must cue the video and allow the user to invoke play

player.cueVideoById(videoId);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cannot play YouTube videos in Firefox - Opera works?

From Dev

Cannot play YouTube videos in Firefox - Opera works?

From Dev

How to Play youtube videos in windows phone 7?

From Dev

Unable to play some Youtube videos using YouTube Android Player API

From Dev

Play YouTube Videos in WPF

From Dev

YouTube API Uploading Videos

From Dev

Using Flexslider to play Youtube videos

From Dev

YouTube - Download/Play Private Videos

From Dev

How to play private videos in YouTube?

From Dev

YouTube videos to play through JSON

From Dev

At what level is the Android Camera2 API supported on the Samsung Galaxy S7

From Dev

YouTube videos (using latest API) won't play on Chrome on Android?

From Dev

How to play two side by side videos from youtube api

From Dev

Play youtube without opening tab

From Dev

Category List for Youtube Videos (API)

From Dev

YouTube API truncates videos [PHP]

From Dev

Youtube API only search for videos

From Dev

youtube api playlistitems deleted videos

From Dev

Youtube API only search for videos

From Dev

youtube api playlistitems deleted videos

From Dev

Youtube API multiple videos with events

From Java

Youtube api v3 Get list of user's videos

From Dev

Youtube api display limited videos from user's playlist android

From Dev

How to debug CSS website on Samsung Galaxy S5 default browser?

From Dev

How to force youtube to play HD videos

From Dev

Play Youtube videos in Video View in android

From Dev

How to play YouTube videos using MPMoviePlayer?

From Dev

Clicking on <li> items to play youtube videos

From Dev

VLC - YouTube videos won't play anymore