Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
b660bab0
Commit
b660bab0
authored
Mar 05, 2012
by
Ernie Park
Browse files
Options
Browse Files
Download
Plain Diff
dont autoplay video on ios devices
parents
ece5dde5
cf71d90d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
js/video_player.js
+20
-3
No files found.
js/video_player.js
View file @
b660bab0
...
...
@@ -198,7 +198,7 @@ function onYouTubePlayerAPIReady() {
}
});
updateytplayerInfoInterval
=
setInterval
(
updateHTML5ytplayerInfo
,
200
);
ajax_videoInterval
=
setInterval
(
ajax_video
,
5000
);
//
ajax_videoInterval = setInterval(ajax_video, 5000);
}
// Need this function to call the API ready callback when we switch to a tab with AJAX that has a video
...
...
@@ -209,9 +209,26 @@ function loadHTML5Video() {
}
}
function
isiOSDevice
(){
var
iphone
=
"iphone"
;
var
ipod
=
"ipod"
;
var
ipad
=
"ipad"
;
var
uagent
=
navigator
.
userAgent
.
toLowerCase
();
//alert(uagent);
if
(
uagent
.
search
(
ipad
)
>
-
1
||
uagent
.
search
(
iphone
)
>
-
1
||
uagent
.
search
(
ipod
)
>
-
1
)
{
return
true
;
}
return
false
;
}
function
onPlayerReady
(
event
)
{
// alert("ready");
event
.
target
.
playVideo
();
//do not want to autoplay on iOS devices since its not enabled
//and leads to confusing behavior for the user
if
(
!
isiOSDevice
())
{
event
.
target
.
playVideo
();
}
}
function
onPlayerStateChange
(
event
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment