Embedding code into a branch page.

Embedding code into a branch page.

Larry Hart
Vastuste arv 14
Hi, I need to embed some code into a branch page and/or question page.

The code is similar to this...

<embed src="http://xxx.xx.amazonaws.com/player/mediaplayer46.swf"
width="600" height="448"
allowscriptaccess="always" allowfullscreen="true"
flashvars="autostart=false&type=rtmp&streamer=rtmp://s1qrmz7k3mgncz.cloudfront.net/cfx/st&abouttext=xxx&aboutlink=http://www.xxx.xx/about/index.cfm?memref=xxxxxxxxx&skin=http://xxx.xx.amazonaws.com/player/Snel2.swf&controlbar=over&stretching=exactfit&allowfullscreen=true&wmode=opaque&file=hs003.flv&width=600&height=448&screencolor=000000&bufferlength=10&volume=80&showicons=true" />

(I have changed the code slightly for privacy but I hope you get the idea). It is code for a streaming video I want to show.

Trouble is, when I paste it into the editor it either does NOT display correctly on the preview or moodle re-writes it and messes it up. I have played with the Modual Filters but this doesn't seem to make any difference.

Please help anyone?

Regards

Larry

Keskmine hinnang: -
Vastuses Larry Hart

Re: Embedding code into a branch page.

Joseph Rézeau
Core developers pilt Particularly helpful Moodlers pilt Plugin developers pilt Testers pilt Translators pilt

Larry,

The question of embedding videos into moodle activities is not directly related to the Lesson module. There is normally no problem embedding videos, provided of course that admin has authorized it in Administration ► Security ► Site policies :: Allow EMBED and OBJECT tags.

Are you able to embed your video in the HTML editor in other activities than Lesson on your moodle site?

Joseph

PS.- It might help if you provided a complete real example of the kind of video you want to embed.

Vastuses Joseph Rézeau

Re: Embedding code into a branch page.

Larry Hart
Thanks Joseph, I have enabled the Embed and Object Tags in Security but it makes no difference.

On a branch page it seems that Moodle is trying to insert its own player and thus fails to work...

error1.jpg

On the other hand... in a webpage I added it works ok...

error2.jpg

The actual code I want to add to a branch page is as follows....

<embed src="http://ezs3.s3.amazonaws.com/player/mediaplayer46.swf"
width="600" height="448"
allowscriptaccess="always" allowfullscreen="true"
flashvars="autostart=false&type=rtmp&streamer=rtmp://s1qrmz7k3mgncz.cloudfront.net/cfx/st&abouttext=eZs3&aboutlink=http://www.ezs3.com/about/index.cfm?memref=Lazersam&skin=http://ezs3.s3.amazonaws.com/player/Snel2.swf&controlbar=over&stretching=exactfit&allowfullscreen=true&wmode=opaque&file=hs003.flv&width=600&height=448&screencolor=000000&bufferlength=10&volume=80&showicons=true" />


Vastuses Larry Hart

Re: Embedding code into a branch page.

Lynn Scarlet Clark
Dear Larry - the phrase you used about Moodle messing things up gives me a hint on what may be causing this. You should be entering any script (other than html) into Moodle with the HTML editor turned off, otherwise Moodle puts in symbols to render the code inoperable, just in case it conflicts with its own code within the page.

To do this, go to your own edit profile page (click on the instance of your name) and make sure Show Advanced is on. Scroll down until you see the field 'When editing text' and make sure 'use standard web forms' is showing against it. Save your profile.

Clearly, you can turn the HTML back on by reversing this process once you've saved your branch page.

Remember that you must turn off HTML when editing ANY part of a page, block or topic that has non-HTML code in it. Just because you're not editing the piece of code itself, Moodle will still shove in symbols when you save the page.

I hope this is the solution you're looking for!
Vastuses Lynn Scarlet Clark

Re: Embedding code into a branch page.

Joseph Rézeau
Core developers pilt Particularly helpful Moodlers pilt Plugin developers pilt Testers pilt Translators pilt

Unfortunately, Scarlet, this is not the solution to the problem that Larry is experiencing.

I can confirm Larry's finding that there is something wrong in the way that the Lesson module displays (or rather does not display) some swf + flv video files.

I will try to look into the matter and keep you posted here.

Joseph

Vastuses Joseph Rézeau

Re: Embedding code into a branch page.

Lynn Scarlet Clark
Ok, sorry for trying to help. I'm sure this is wrong too, but have you tried the advanced flv player? We had problems with streaming flvs showing correctly in lessons before we employed this.

Will shut up now...
Vastuses Lynn Scarlet Clark

Re: Embedding code into a branch page.

Joseph Rézeau
Core developers pilt Particularly helpful Moodlers pilt Plugin developers pilt Testers pilt Translators pilt
The problem seems linked to the Lesson module, since I confirm Larry's finding that his video displays fine using the HTML editor in other Moodle modules.
Vastuses Joseph Rézeau

Re: Embedding code into a branch page.

Joseph Rézeau
Core developers pilt Particularly helpful Moodlers pilt Plugin developers pilt Testers pilt Translators pilt

Got it.cool

If you are willing to hack your core Moodle code, using latest moodle 1.9.9 in file moodle/mod/lesson/view.php, around line 540, change the format in red to format in blue

print_simple_box('<div class="contents">'.
format_text($page->contents, FORMAT_MOODLE, $options).
'</div>', 'center');

change to:

print_simple_box('<div class="contents">'.
format_text($page->contents, FORMAT_HTML, $options).
'</div>', 'center');

See attached result,

Joseph

PS.- Please note that the code of the Lesson module has not been maintained for quite some time now. Hopefully things will get better in Moodle 2.1 (not 2.0).

Manus image00.jpg
Vastuses Lynn Scarlet Clark

Re: Embedding code into a branch page.

Chris Collman
Documentation writers pilt
Scarlet,
Trying to help is always permissible!

Even if you offer an off the mark cure, it might help somebody else with a solution to their problem. The brain, the search engine and context all work in strange and mysterious ways.

I have made more than 1 "wrong" suggestion, as many can attest. If you read some of my posts you can see my qualifications like: "I do not deal with code much but I wonder if...." My attitude is that we learn by doing: try to duplicate the issue, I watch what happens after the injection of my idea/comment (usually long, so unlike my terse edits in MoodleDocs naeratus ), learn, and try to be gracious to all.

Just remember that grace can be defined both in the eye of the receiver and in the eye of the giver.

Keep those comment coming.

Chris
Vastuses Chris Collman

Re: Embedding code into a branch page.

Lynn Scarlet Clark
Thanks very much Chris for your supportive comments!
Vastuses Lynn Scarlet Clark

Re: Embedding code into a branch page.

Joseph Rézeau
Core developers pilt Particularly helpful Moodlers pilt Plugin developers pilt Testers pilt Translators pilt

Hi Chris and Scarlet,

Thanks for your help (Scarlet) and encouraging comments (Chris). Help is always welcome in these forums, and two (or more) heads are better than one.wink

Now we'll have to wait for the OP's reply*, hoping that we have finally solved his problem.

Joseph

*OP = Original Poster

Vastuses Joseph Rézeau

Re: Embedding code into a branch page.

Larry Hart
Thanks everyone! Scarlet Your suggestion seemed very logical to me and I tried it - unfortunately I had the same result as before.

I changed the code as Joseph suggested and this seems to have worked! The player is working on the Lesson Branch page (so far).

I really appreciate your help guys lai irve
Vastuses Larry Hart

Re: Embedding code into a branch page.

Chris Collman
Documentation writers pilt

Just a thanks to both Larry and Joseph.   My admin just tasked me with getting Flash to work in 1.9.9 in a Lesson.  When I get to work tomorrow,  I will charge the code in a localhost (just to make sure I got it right) and then in our production site .

Sounds to me as if the "Moode_format" has carried forward from 1.4 naeratus

Chris

 

Vastuses Joseph Rézeau

How to Embed quiz into a branch page.

lavanya mohan

Hi,

How to include quiz inside the lesson of branch page? 

Vastuses lavanya mohan

Re: How to Embed quiz into a branch page.

Joseph Rézeau
Core developers pilt Particularly helpful Moodlers pilt Plugin developers pilt Testers pilt Translators pilt

lavanya mohan "How to include quiz inside the lesson of branch page?"

You can't. Quiz and Lesson are 2 totally separate Moodle activities.

Joseph