hughred22 / YouTube-Video-Listing-Ionic-Mobile-App

A hybrid mobile app build with Ionic Framework, AngularJS and YouTube API V3.
91 stars 37 forks source link

Scroll Events #4

Open emgould opened 8 years ago

emgould commented 8 years ago

The only problem with this general approach is that if a user tries to scroll by swiping on the video iframe, it does not scroll as would be expected by the user.

hughred22 commented 8 years ago

The actual app I used this is actually considering the Scrolling issue you mentioned. You can defer loading the video (for scrolling performance). Grab only the Cover Image and generate a play icon using SVG. Then when user click play, do the get request, load the video and play the video. So the iframe only be accessible in the DOM only after user click the cover image (the play icon). On iOs, it will need to double click b/c video autoplay is disable by default. But this should solve your issue nicely. Give it a try.