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

Stop video going full screen on iPhone

Community Beginner ,
May 16, 2017 May 16, 2017

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

many thanks in advanced

4.1K
Translate
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", "");

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

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

Translate
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

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

Translate
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

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.

Translate
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

The following code seems to be the working solution;

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

Translate
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

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

Translate
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

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

Translate
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
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

Translate
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