I am using audio.js audio player in angularjs. but it is not working properly.
I have different audio Urls which are being passed through $scope to ng-src.when i click on any audio. it plays the audio. when i stop it and play the another audio. it still plays the previous audio. it seems that modal value is not getting cleared. everytime it will only play that audio which i have played first.
<audio ng-src="{{audioUrl}}" preload="false" id="callaudio" />
here audioUrl remians the very first url and doesn't get changed while clicking on other links.it still plays the same audio.
i chacked the value of audioUrl in console. it changed every time when i click on any link.
but in ng-src={{audioUrl}} it remains same.
kindly help me.I am breaking my head for last two days.
thanks
Try this
< audio>
<source src = "{{audio.Url}}"type = "{{audio.AudioType}}" >
< /audio>
Related
I am developing a PHP backend to my mobile app.
There is a part where I need to show and play a hosted video file.
This is how am I trying it:
$data[$i]['video'] = '<video controls width="500", height="300><source src="pacientes/'.$data[$i]['video'].'" type= "video/mp4; codecs="avc1.42E01E, mp4a.40.2"></video>';
Here hou have the value for $data[$i]['video'] that should be an example of the kind of video files I will find in he backend
32365bec-7ec8-4b16-a91c-58e12f68cdba1575964120438935622.mp4
And here yoy have the video file URL
https://capenergy-app.com/administrar/application/admin/pacientes/32365bec-7ec8-4b16-a91c-58e12f68cdba1575964120438935622.mp4
And here you a screenshot from the video player using the above code to show it.
The video is not played when clicking on the play button, and the video duration is set to 0:00.
What do I need to change to my code to show the video and let me play it?
You must put the full video path at the source's src
<source src="full_path" > </source>
Double check spelling, for example: some " are missing. And there is no need to add a , after attributes.
Fix:
$data[$i]['video'] = '<video controls width="500" height="300"><source src="pacientes/'.$data[$i]['video'].'" type= "video/mp4"; codecs="avc1.42E01E, mp4a.40.2"></video>';
I use the video as a background. The background works well everywhere except the iPhone. I deleted the audio track, but it does not help. How can I play video on iPhone?
PHP CODE
<!-- BACKGROUND VIDEO LAYER -->
<div class="rs-background-video-layer"
data-forcerewind="on"
data-volume="mute"
data-videowidth="100%"
data-videoheight="100%"
data-videomp4="/wp-content/themes/SCALE/wp-content/uploads/2016/03/Working.mp4 "
data-videopreload="auto"
data-videoloop="loopandnoslidestop"
data-forceCover="1"
data-aspectratio="16:9"
data-autoplay="true"
data-autoplayonlyfirsttime="true"></div>
It seems that while the autoplay restriction is lifted for non-audio videos, if you have it in other versions there could be a conflict. You could try adding the property 'muted' or try the workaround suggested here: Can you autoplay HTML5 videos on the iPad?
Try to resize and compress your video to 7mb, then it may start to play.
It helped me, and for desktop I kept full video length.
For long time I use this "replace function" to get the thumbnails by Instagram API, it worked well but now they changed somethings and I no longer to use bigger thumbnails by this way.
src="<?= str_replace('s150x150/', 's320x320/', $post->images->thumbnail->url) ?>">
By default thumbnail, it works well.
https://scontent.cdninstagram.com/vp/94387bd7b8a247f3f4039f8789772142/5AEE2A9E/t51.2885-15/s150x150/e35/c0.135.1080.1080/26335890_2247807142112483_5882778660510892032_n.jpg
But replaced thumbnail size to bigger, it appears a msg: Invalid URL signature.
https://scontent.cdninstagram.com/vp/94387bd7b8a247f3f4039f8789772142/5AEE2A9E/t51.2885-15/s320x320/e35/c0.135.1080.1080/26335890_2247807142112483_5882778660510892032_n.jpg
Anyone can help to get bigger thumbnail of Instagram. They changed API and I feel so tired with Facebook, they have made many changes since sync with FB and everytime like this, the developers have to update with no instructions.
You can try with this trick
src="<?= str_replace('s150x150/', 's320x320/', str_replace('vp/', '', $post->images->thumbnail->url)) ?>">
or
src="<?= str_replace('s150x150/', 's640x640/', str_replace('vp/', '', $post->images->thumbnail->url)) ?>">
You have to replace (delete) also "vp/" on url, and works again.
It's a really bad solution, but it's the only that i've found.
Copy the link of the profile pic after the "/s150x150/xxxxxxxx......jpg" to the end of this:
"https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/"
like: https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/xxxxxxxx......jpg
Works right now.
A solution would be very nice!
I have also done it like you the last few month.
I think one of the solutions is to use non-squared fotos from instagram (you get with "standard_resolution") and set it as a background-image and do the "square" via css and display cover…
This is my personal solution at the moment…
i opened instagram on google chrome selected the desired post, right-clicked to "save as". after opening the saved html doc. in chrome i right-clicked again to veiw page source. i scrolled down to line 217 of the page source and one of the links there gave me the picture i wanted. not sure that it is the same thing as before but it let me download the picture of the post in a .jpg format. hope this helps
When I code the src with an .aac I cannot get the audio player to work
'<audio controls ><source type="audio/aac" src="'.$mTheMediaLocation.'" ></audio>'
If I Build the data from a data string then It's fine..
<audio controls id="myAudio"><source src="data:audio/aac;base64,'.base64_encode($mTheMediaData).'"></audio>'
I want the src to be a file, I'm aware of browser support etc. BUT if the one works surely there is a way to get the other to work aswell ?
I'm desperately (hours of research and no luck so far) trying to create a PHP page which can be used as a path for video embedding. I'm doing this so that I can give out a path to 3rd parties, that they can use for embedding, which won't change, even if I have to host the video elsewhere.
I've tried using the code referenced here...
Reading mp4 files with PHP
... but it doesn't work at all for me.
The video files will be hosted on a CDN and 3rd parties will need fixed links that they can embed on their own sites like:
<div data-swf="$resourcePath/resources/flowplayer.commercial-5.4.3/flowplayer.swf" class="flowplayer is-splash play-button" data-ratio="0.5625">
<video>
<source type="video/mp4" src="http://www.mycdndomain.com/embed/loader.php?v=1"/>
</video>
</div>
Thanks in advance.
-Josh