• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Stop video going full screen on iPhone

Community Beginner ,
May 16, 2017 May 16, 2017

Copy link to clipboard

Copied

how do I add the playsinline to the video tag in Animate?

many thanks in advanced

Views

3.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , May 18, 2017 May 18, 2017

The following code seems to be the working solution;

$("#video")[0].setAttribute("playsinline", "");

Votes

Translate

Translate
Community Expert ,
May 16, 2017 May 16, 2017

Copy link to clipboard

Copied

what's the purpose?  eg, are you trying to prevent fullscreen?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 16, 2017 May 16, 2017

Copy link to clipboard

Copied

sorry yes, stop video going full screen on iphone with iOS 10

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 16, 2017 May 16, 2017

Copy link to clipboard

Copied

I'm assuming you're using the HTML5 video component. This might work:

document.getElementById("yourVideoComponentName").setAttribute("playsinline", "");

Place on the timeline at least one frame after the video component's first appearance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

The following code seems to be the working solution;

$("#video")[0].setAttribute("playsinline", "");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

If you want to use jQuery for no reason, I suppose that would be a better solution than what I provided.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Sorry but I couldn't seem to get the document.getElementById() part of the code to work inside Animate, am i doing something wrong?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

LATEST

$("#whatever")[0] and document.getElementById("whatever") are functionally identical. Did you actually change the getElementById parameter to "video"?

javascript - document.getElementById vs jQuery $() - Stack Overflow

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines