angularjs - Refresh/Reinitialize Home Page - Angular JS -


i have video plays on home page , when navigate other pages no longer shows (which want). when click on link go home page, want video start playing again or show up. want refresh page/state of home page when redirect it. have attempted few ways try , happen, no luck! here code have (this not include have tried).

what want happen when click away home page , click on link (shown in index.html snippet) want page go it's original state of when video showed , played. no longer see video. assumption when move away , come home page, controller doesn't reinit, since it's created. want try , refresh or reinit home page

index.html enter image description here

homectrl

enter image description here

homesvc

enter image description here

app.js enter image description here

i appreciate help!!

the function on event $routechangestart make issue. because when leave home page, player stopped , removed dom. when come home page, he's removed.

are obliged remove player stopping ? keep playing when go other page if don't delete ?

try removing part below , tell without

 $scope.$on($routechangestart...); 

edit

i should have advice giving plugin, poor in opinion. use angular, should keep working angular plugin instead of jquery, have many ones ! after quick research, found 2 maintained projects, first 1 angular-video-background seem stable enough, , richer okvideo. second ngvideo pretty same thing. choose want.

with these 2 angular plugins, main advantage play/pause control. keep watcher on $routechangestart within force pause , play depending reach. 1 sure thing, leave jquery plugin okvideo

edit 2

take @ videogular seems popular


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -