Copy link to clipboard
Copied
Hi. I'm just learning coding, but I see here that in order to prevent a video from automatically playing in quicktime on an iPhone you have to add
<video playsinline>
New <video> Policies for iOS | WebKit
Where do I add this in Animate?
Thanks!
Copy link to clipboard
Copied
Should I post this in the dreamweaver forum?
Copy link to clipboard
Copied
if you're using the video component just assign the src and don't execute a play(). eg,
$("#video_component_name")[0].src = videoURL;
if you wanted it to play automatically,
$("#video_component_name")[0].src = videoURL;
$("#video_component_name")[0].play();
Copy link to clipboard
Copied
Sorry I meant I don’t want it to play in iPhone‘s native player, I want it to play on the page where it’s at. But not open the player, so you see what I mean?
Copy link to clipboard
Copied
are you creating an air or html5/canvas project?
Copy link to clipboard
Copied
Html5 sorry I thought I mentioned that in the original post.
Copy link to clipboard
Copied
are you using the video component?
Copy link to clipboard
Copied
yeah
Copy link to clipboard
Copied
then remove that webkit stuff and just use your createjs code.
Copy link to clipboard
Copied
Thanks! but what is that, and where do I put it in animate?
Copy link to clipboard
Copied
where is what? webkit?
it's not in animate. you're the one that mentioned it.
look, start a new fla
add the video component
assign an instance name
then, while the component is still selected, use the web snippets panel to assign your video's url
test.
any problem?
Copy link to clipboard
Copied
Ok now nothing works, the page just won't load. Here's my code with the changes you mentioned, did I do something wrong?:
this.stopBtn.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
$("#video1")[0].stop();
}
this.playBtn.addEventListener("click", fl_MouseClickHandler_2.bind(this));
function fl_MouseClickHandler_2()
{
$("#video1")[0].src = /videos/2.mp4;
this.pauseBtn.visible = true;
}
this.pauseBtn.addEventListener("click", fl_MouseClickHandler_3.bind(this));
function fl_MouseClickHandler_3()
{
$("#video1")[0].pause();
this.pauseBtn.visible = false;
}
Copy link to clipboard
Copied
open your browser's console and check for error messages (in particular, that path/name to your mp4)
Copy link to clipboard
Copied
Ok but the page won't even load at all. There are two errors:
Uncaught SyntaxError: Invalid regular expression flags
second.html?12111564:32
Uncaught ReferenceError: AdobeAn is not defined
at init (second.html?12111564:32)
at onload (second.html?12111564:70)
Copy link to clipboard
Copied
Also I really appreciate you teaching me this stuff but if at any point you'd want me to send you the .fla file so you can see things first hand just let me know and I will.
Copy link to clipboard
Copied
there's no stop() method of videos. ie, remove your stop button or have it call your pause function.
Copy link to clipboard
Copied
Oh thanks I was not aware of that. However, I've deleted the stop button code altogether and it's still giving the same error messages and won't load at all:
Uncaught SyntaxError: Invalid regular expression flags
second.html?44938056:32 second.js:339
Uncaught ReferenceError: AdobeAn is not defined
at init (second.html?44938056:32)
at onload (second.html?44938056:70)
Copy link to clipboard
Copied
what’s line 339 of second.js
Copy link to clipboard
Copied
It's the code you told me to enter. What does that mean?
Copy link to clipboard
Copied
copy and paste line 339
Copy link to clipboard
Copied
$("#video1")[0].src = /videos/2.mp4;
Copy link to clipboard
Copied
Line 339 is above, but here's my complete frame 1 code in case it helps:
this.stop();
var nextBtnVAR = this.nextBtn;
var timelineVAR = this;
this.playBtn.addEventListener("click", playVideoFUNC.bind(this));
function playVideoFUNC()
{
$("#video1")[0].src = /videos/2.mp4;
this.pauseBtn.visible = true;
}
this.pauseBtn.addEventListener("click", pauseVideoFUNC.bind(this));
function pauseVideoFUNC()
{
$("#video1")[0].pause();
this.pauseBtn.visible = false;
}
this.nextBtn.addEventListener("click", nextFrameFUNC.bind(this));
function nextFrameFUNC()
{
this.gotoAndStop(2);
}
this.video1.on("added", function()
{
$("#video1")[0].addEventListener('ended', timelineVAR.endedHandler);
}
);
this.endedHandler = function(e)
{
timelineVAR.gotoAndStop(1);
this.pauseBtn.visible = false;
};
Copy link to clipboard
Copied
your path/name is incorrect. to confirm test with:
Copy link to clipboard
Copied
Now the page loads but the video won't play, here's the error message:
Failed to load resource: the server responded with a status of 404 (Not Found)
e9cf12a0-7c4b-414f-a5c9-97ef49340aa9_20160203035417.960x540at1200_h264.mp4:1
and here's the code:
$("#video1")[0].src = "https://images-tv.adobe.com/avp/vr/15a99ccf-0e7c-4601-b270-87dd82624086/5078a43c-81f9-4a93 -836c-815278b83a8e/e9cf12a0-7c4b-414f-a5c9-97ef49340aa9_20160203035417.960x540at1200_h264.mp4";
Copy link to clipboard
Copied
Edit: I noticed there was a line break in the code I just pasted, so I deleted the empty space. Now the page loads but the video won't play and it gives me no error message.